Communication apparatus

ABSTRACT

A first communication apparatus may receive first identification information for identifying a first wireless network and second identification information for identifying a second wireless network via a first type of interface from a second communication apparatus, in a case where the second communication apparatus currently belongs to both the first wireless network and the second wireless network. The first communication apparatus may select, from among the first and second wireless networks, by using the first and the second identification information, at least one wireless network to which the first communication apparatus currently belongs, and execute a wireless communication for target data with the second communication apparatus via a second type of interface by using a target wireless network included in the selected at least one wireless network.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation application of U.S. patentapplication Ser. No. 15/461,843 filed on Mar 17, 2017 which is acontinuation application of U.S. patent application Ser. No. 14/037,599filed on Sep. 26, 2013, now U.S. Pat. No. 9,603,114 issued on Mar. 21,2017 and claims priority to Japanese Patent Application No. 2012-283463,filed on Dec. 26, 2012, the contents of each of which are herebyincorporated by reference into the present application.

TECHNICAL FIELD

A communication apparatus for executing a wireless communication fortarget data is disclosed in the present specification.

DESCRIPTION OF RELATED ART

In a known technique, when a mobile phone establishes an NFCcommunication with a counterpart apparatus, the mobile phone determineswhether or not a power state of Bluetooth (registered trademark) of themobile phone is ON. In case the power state of Bluetooth is ON, themobile phone sends a request for Bluetooth to be a handover destinationto the counterpart apparatus by using the NFC communication. In thiscase, the mobile phone executes a wireless communication with thecounterpart apparatus by using Bluetooth. In case the power state ofBluetooth is not ON, the mobile phone sends a request for acommunication means (Bluetooth or wireless LAN) selected by a user to bea handover destination to the counterpart apparatus by using the NFCcommunication. In this case, the mobile phone executes a wirelesscommunication with the counterpart apparatus by using the communicationmeans selected by the user.

SUMMARY

In the above technique, a situation in which the counterpart apparatusbelongs to a plurality of wireless networks is not disclosed at all. Inthe present specification, a technique is disclosed that, a firstcommunication apparatus and a second communication apparatus mayappropriately execute a wireless communication for target data, in acase where a second communication apparatus belongs to a plurality ofwireless networks.

One aspect disclosed in the present specification may be a firstcommunication apparatus. The first communication apparatus may comprise:a first type of interface for executing a wireless communication with asecond communication apparatus; a second type of interface for executinga wireless communication with the second communication apparatus; and acontroller. The controller may be configured to perform: receiving firstidentification information for identifying a first wireless network andsecond identification information for identifying a second wirelessnetwork via the first type of interface from the second communicationapparatus, in a case where the second communication apparatus currentlybelongs to both the first wireless network and the second wirelessnetwork; selecting, from among the first wireless network and the secondwireless network, by using the first identification information and thesecond identification information, at least one wireless network towhich the first communication apparatus currently belongs; and executinga wireless communication for target data with the second communicationapparatus via the second type of interface by using a target wirelessnetwork included in the selected at least one wireless network.

One aspect disclosed in the present specification may be a secondcommunication apparatus. The second communication apparatus maycomprise: a first type of interface for executing a wirelesscommunication with a first communication apparatus; a second type ofinterface for executing a wireless communication with the firstcommunication apparatus; and a controller. The controller may beconfigured to perform: sending first identification information foridentifying a first wireless network and second identificationinformation for identifying a second wireless network via the first typeof interface to the first communication apparatus, in a case where thesecond communication apparatus currently belongs to both the firstwireless network and the second wireless network, the firstidentification information and the second identification informationbeing used by the first communication apparatus to select, from amongthe first wireless network and the second wireless network, at least onewireless network to which the first communication apparatus currentlybelongs; and executing a wireless communication for target data with thefirst communication apparatus via the second type of interface by usinga target wireless network included in the selected at least one wirelessnetwork.

A control method, a computer program, and computer-readable instructionsfor realizing the first and/or the second communication apparatus, and anon-transitory computer-readable medium that stores the computer programor the computer-readable instructions, are also novel and useful.Further, a communication system comprising the first and the secondcommunication apparatuses is also novel and useful.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows the configuration of a communication system.

FIG. 2 shows a sequence diagram representing how an MFP and a portableterminal belong to a wireless network.

FIG. 3 shows a flowchart of an application process of the portableterminal.

FIG. 4 shows a flowchart of a communication process of the MFP.

FIG. 5 shows a sequence diagram of case 1-1 and case 1-2.

FIG. 6 shows a sequence diagram of case 1-3 and case 1-4.

FIG. 7 shows a sequence diagram of case 1-5.

FIG. 8 shows a sequence diagram of case 1-6 and case 1-7.

FIG. 9 shows a flowchart of a communication process of the MFP of asecond embodiment.

FIG. 10 shows a sequence diagram of case 2.

FIG. 11 shows a flowchart of a communication process of the MFP of athird embodiment.

FIG. 12 shows a sequence diagram of case 3. FIG. 13 shows a flowchart ofa communication process of the MFP of a fourth embodiment.

FIG. 14 shows a sequence diagram of case 4-1 and case 4-2.

FIG. 15 shows a flowchart of an application process of the portableterminal of the fifth embodiment.

FIG. 16 shows a flowchart of a communication process of the MFP of thefifth embodiment.

FIG. 17 shows a sequence diagram of case 5-1 and case 5-2.

EMBODIMENT First Embodiment

(Configuration of Communication System 2)

As shown in FIG. 1, a communication system 2 comprises a plurality ofaccess points (called “AP (an abbreviation of Access Point)” below) 4A,4B, a plurality of PCs (an abbreviation of Personal Computer) 6A, 6B, amulti-function peripheral (called “MFP (an abbreviation ofMulti-Function Peripheral)” below) 10, and a portable terminal 50.

(Configuration of MFP 10)

The MFP 10 is a peripheral apparatus capable of executing multiplefunctions including a print function and a scan function. The MFP 10comprises an operating unit 12, a display unit 14, a print executionunit 16, a scan execution unit 18, a wireless LAN (an abbreviation ofLocal Area Network) interface 20, an NFC (an abbreviation of Near FieldCommunication) interface 22, and a controller 30. The units 12 to 30 areconnected to a bus line (reference number omitted). Below, interface isreferred to as “I/F”.

The operating unit 12 comprises a plurality of keys. A user can givevarious instructions to the MFP 10 by operating the operating unit 12.The display unit 14 is a display for showing various information. Theprint execution unit 16 is an ink jet method, laser method, etc.printing mechanism. The scan execution unit 18 is a CCD, CIS, etc.scanning mechanism.

The wireless LAN I/F 20 is an interface for executing a wirelesscommunication, and is physically one interface (i.e., one IC chip).However, a MAC address (called “WFD MAC” below) used in wirelesscommunication (called “WFD communication” below) according to a WFD (anabbreviation of Wi-Fi Direct) method, and a MAC address (called “normalWi-Fi MAC” below) used in wireless communication (called “normal Wi-Ficommunication” below) according to a normal Wi-Fi method are bothassigned to the wireless LAN I/F 20.

Specifically, the normal Wi-Fi MAC is assigned in advance to thewireless LAN I/F 20. By using the normal Wi-Fi MAC, the controller 30creates the WFD MAC which is different from the normal Wi-Fi MAC, andassigns the WFD MAC to the wireless LAN I/F 20. Consequently, thecontroller 30 can simultaneously execute both a normal Wi-Ficommunication using the normal Wi-Fi MAC, and a WFD communication usingthe WFD MAC. The WFD communication and the normal Wi-Fi communicationwill be described in detail later.

The NFC I/F 22 is an interface for executing NFC communication. NFCcommunication is a wireless communication according to an NFC system forso-called short distance wireless communication. The NFC system is awireless communication system based on e.g., international standardsISO/IEC21481 or 18092. A chip configuring the NFC I/F 22, and a chipconfiguring the wireless LAN I/F 20 are physically different.

A communication speed of a wireless communication using the wireless LANI/F 20 (e.g., maximum communication speed is 11 to 600 Mbps) is fasterthan a communication speed of a wireless communication using the NFC I/F22 (e.g., maximum communication speed is 100 to 424 Kbps). Further,frequency of a carrier wave in a wireless communication using thewireless LAN I/F 20 (e.g., 2.4 GHz band, 5.0 GHz band) differs fromfrequency of a carrier wave in a wireless communication using the NFCI/F 22 (e.g., 13.56 MHz band). Further, in case e.g., distance betweenthe MFP 10 and the portable terminal 50 is less than or equal toapproximately 10cm, the controller 30 can execute an NFC communicationwith the portable terminal 50 by using the NFC I/F 22. On the otherhand, in both a case where distance between the MFP 10 and the portableterminal 50 is less than or equal to 10cm, or a case where the distanceis greater than or equal to 10 cm (e.g., at a maximum is approximately100m), the controller 30 can execute a WFD communication and a normalWi-Fi communication with the portable terminal 50 by using the wirelessLAN I/F 20. That is, a maximum distance across which the MFP 10 canexecute a wireless communication with a communication destinationapparatus (e.g., the portable terminal 50) by using the wireless LAN I/F20 is greater than a maximum distance across which the MFP 10 canexecute a wireless communication with the communication destinationapparatus by using the NFC I/F 22.

The controller 30 comprises a CPU 32 and a memory 34. The CPU 32executes various processes according to a program stored in the memory34. The CPU 32 realizes the functions of units 41 to 49 by executingprocesses according to the program. Moreover, units 42A, 46 to 49 areunits which function in a fourth or fifth embodiment (to be described),and consequently may be omitted in the present embodiment.

(Configuration of Portable Terminal 50)

The portable terminal 50 is a portable terminal device such as a mobilephone (e.g., a Smart Phone), PDA, notebook PC, tablet PC, portable musicplayback device, portable video playback device, etc. The portableterminal 50 comprises an operating unit 52, a displaying unit 54, awireless LAN I/F 60, an NFC I/F 62 and a controller 70. The units 52 to70 are connected to a bus line (reference number omitted).

The operating unit 52 comprises a plurality of keys. The user can givevarious instructions to the portable terminal 50 by operating theoperating unit 52. The displaying unit 54 is a display for displayingvarious information.

The wireless LAN I/F 60 and the NFC I/F 62 are respectively similar tothe wireless LAN I/F 20 and the NFC I/F 22 of the MFP 10. That is, botha WFD MAC and a normal Wi-Fi MAC are assigned to the wireless LAN I/F60. Consequently, the controller 70 may simultaneously execute both anormal Wi-Fi communication using the normal Wi-Fi MAC, and a WFDcommunication using the WFD MAC. Moreover, the WFD MAC and the normalWi-Fi MAC of the portable terminal 50 are respectively different fromthe WFD MAC and the normal Wi-Fi MAC of the MFP 10. Further, mutuallydiffering points of the wireless LAN I/F 60 and the NFC I/F 62 aresimilar to mutually differing points of the wireless LAN I/F 20 and theNFC OF 22. For example, a communication speed of a wirelesscommunication using the wireless LAN I/F 60 is faster than acommunication speed of a wireless communication using the NFC I/F 62.

The controller 70 comprises a CPU 72 and a memory 74. The CPU 72executes various processes according to a program stored in the memory74. The CPU 72 realizes the functions of units 81 to 89 by executingprocesses according to the program. Moreover, the units 81, 82, 85 areunits which function in the fifth embodiment (to be described), andconsequently may be omitted in the present embodiment.

The memory 74 stores an application 76 for causing the MFP 10 to executea function (e.g., print function, scan function, etc.). The application76 may, e.g., be installed on the portable terminal 50 from a serverprovided by a vendor of the MFP 10, or may be installed on the portableterminal 50 from a media shipped together with the MFP 10.

(Other Apparatuses 4A, 4B, 6A, 6B)

The APs 4A, 4B are each a standard access point called a wireless accesspoint, wireless LAN router, etc., and are different from a so-calledSoft AP of a WFD method G/O apparatus (to be described) or of the normalWi-Fi method. The APs 4A, 4B can form a wireless network according tothe normal Wi-Fi method. Further, the PCs 6A, 6B are each a knowncomputer that operates according to an OS program. The PCs 6A, 6B canexecute a WFD communication according to the WFD method.

(WFD and Normal Wi-Fi)

Next, WFD communication according to the WFD method and normal Wi-Ficommunication according to the normal Wi-Fi method will be described indetail. As described above, in terms of the MAC address used by the MFP10 or the portable terminal 50, the WFD communication and the WFD methodare respectively a wireless communication and wireless communicationsystem in which the WFD MAC is used. Further, the normal Wi-Ficommunication and the normal Wi-Fi method are respectively a wirelesscommunication and wireless communication system in which the normalWi-Fi MAC is used.

(WFD)

The WFD method is a wireless communication system described in thestandard document “Wi-Fi Peer-to-Peer (P2P) Technical SpecificationVersion 1.1”, created by Wi-Fi Alliance. The WFD method is a wirelesscommunication system for executing wireless communication in accordancewith, e.g., IEEE (an abbreviation of The Institute of Electrical andElectronics Engineers, Inc.) standard 802.11 and standards conformingthereto (e.g., 802.11a, 11b, 11g, 11n, etc.).

Below, an apparatus capable of executing a WFD communication accordingto the WFD method, such as the MFP 10, the portable terminal 50, etc. iscalled a “WFD-compatible apparatus”. In the WFD standard document, threestates are defined as the states of the WFD-compatible apparatus: GroupOwner state (called “G/O state” below), client state (called “CL state”below), and device state. The WFD-compatible apparatus is capable ofselectively operating in one state among the three states.

When a pair of WFD-compatible apparatuses that are in the device stateare to newly form a wireless network, the pair of WFD-compatibleapparatuses usually execute a wireless communication called G/Onegotiation. In the G/O negotiation, it is determined that one of thepair of WFD-compatible apparatuses will assume the G/O state (i.e.,become a G/O apparatus), and that the other of the pair ofWFD-compatible apparatuses will assume the CL state (i.e., become a CLapparatus). Then the pair of WFD-compatible apparatuses establishes aconnection and forms the wireless network.

Below, a wireless network formed according to a procedure (e.g., G/Onegotiation) of the WFD method is called a “WFD NW”. At a stage of newlyforming the WFD NW by means of G/O negotiation, only one G/O apparatusand one CL apparatus belong to the WFD NW. However, the G/O apparatuscan establish a connection with another apparatus, and cause the otherapparatus to newly participate in the WFD NW as a CL apparatus. In thiscase, a state is formed in which two or more CL apparatuses belong tothe WFD NW. That is, one G/O apparatus and one or more CL apparatusesmay be present in the WFD NW. The G/O apparatus manages the one or moreCL apparatuses. Specifically, the G/O apparatus registers the MACaddress of each of the one or more CL apparatuses in a management listin the memory of the G/O apparatus. Further, when the CL apparatussecedes from the WFD NW, the G/O apparatus deletes the MAC address ofthe CL apparatus from the management list. Moreover, when a number of CLapparatuses becomes zero (i.e., a number of MAC addresses registered inthe management list becomes zero), the G/O apparatus usually shifts fromthe G/O state to the device state, and dissolves the WFD NW.

An upper value for the number of CL apparatuses that can be managed bythe G/O apparatus (i.e., an upper value for the number of MAC addressesof CL apparatuses that can be registered in the management list) isdetermined in advance by the G/O apparatus. In the present embodiment,the upper value for the number of CL apparatuses that can be managed bythe G/O apparatus is an integer of two or more. However, in a variant,one may be the upper value for the number of CL apparatuses that can bemanaged by the G/O apparatus. That is, the upper value for the number ofCL apparatuses that can be managed by the G/O apparatus may be aninteger of one or more.

The G/O apparatus can execute a wireless communication for target datawith a CL apparatus registered in the management list without going viaanother device. The target data is data that includes network layerinformation of the OSI reference model, and information of a layerhigher than the network layer (e.g., application layer), e.g., thatincludes print data, scan data, etc. Further, the G/O apparatus iscapable of relaying a wireless communication for the target data betweena plurality of CL apparatuses. In other words, a pair of CL apparatusescan execute a wireless communication for the target data via the G/Oapparatus.

As described above, in the WFD NW, a wireless communication for thetarget data can be executed between a WFD-compatible apparatus that is asending source of the target data and a WFD-compatible apparatus that isa sending destination of the target data without passing via an AP(e.g., the APs 4A, 4B) configured separately from these WFD-compatibleapparatuses. That is, it can be said that the WFD communication and theWFD method are respectively a wireless communication not via an AP and awireless communication system not using an AP.

Moreover, differences between the WFD G/O apparatus and the AP (e.g.,the APs 4A, 4B) are as follows. That is, in case the WFD G/O apparatussecedes from the WFD NW to which this apparatus belongs, and newlybelongs to another WFD NW, the WFD G/O apparatus may operate in a state(i.e., CL state) different from the G/O state. By contrast, the AP canonly execute the same operation as the G/O state of WFD (e.g., relaywireless communication), and cannot execute the same operation as the CLstate of WFD.

The G/O apparatus cannot execute a wireless communication for the targetdata with a WFD-compatible apparatus in the device state (i.e., a deviceapparatus), but can execute a wireless communication, with a deviceapparatus, of data for connecting with the WFD method. That is, byexecuting a wireless communication with the device apparatus of data forconnecting with the WFD method, the G/O apparatus can establish aconnection with the device apparatus, and cause the device apparatus toparticipate in the WFD NW. In other words, by executing a wirelesscommunication, with the G/O apparatus, of the data for connecting withthe WFD method, the device apparatus can establish a connection with theG/O apparatus and can participate in the WFD NW. In this case, thedevice apparatus shifts from the device state to the CL state. The datafor connecting with the WFD method is data including information of alayer lower than the network layer of the OSI reference model (e.g.,physical layer, data link layer) (i.e., data not including network layerinformation), e.g., including a Probe Request signal, Probe Responsesignal, Provision Discovery Request signal, Provision Discovery Responsesignal, Association Request signal, Association Response signal,Authentication Request signal, Authentication Response signal, 4-WayHandshake signal, etc.

Further, by executing a wireless communication, with the normal Wi-Fiapparatus, of data for connecting with the normal Wi-Fi method, the G/Oapparatus can establish a connection with the normal Wi-Fi apparatus,and cause the normal Wi-Fi apparatus to participate in the WFD NW. Thenormal Wi-Fi apparatus is an apparatus which cannot belong to a wirelessnetwork according to the WFD method (i.e., cannot execute a G/Onegotiation), but can belong to a wireless network according to thenormal Wi-Fi method. The normal Wi-Fi apparatus is also called a “legacyapparatus”. Except for the point that the data for connecting with thenormal Wi-Fi method does not include the Provision Discovery Requestsignal and the Provision Discovery Response signal, the data forconnecting with the normal Wi-Fi method is the same as the data forconnecting with the WFD method. In case of establishing a connectionwith a normal Wi-Fi apparatus, the G/O apparatus describes a MAC addressof the normal Wi-Fi apparatus in the management list. Thereby, thenormal Wi-Fi apparatus can participate in the WFD NW. The normal Wi-Fiapparatus is not capable of selectively operating in any state of thethree states (i.e., G/O state, CL state, device state), but operates ina state similar to a CL apparatus while belonging to the WFD NW.

As described above, the G/O apparatus can establish a connection with aWFD-compatible apparatus (i.e., a device apparatus) or a normal Wi-Fiapparatus, and cause the WFD-compatible apparatus or normal Wi-Fiapparatus to newly participate in the WFD NW. However, unlike the G/Oapparatus, the CL apparatus cannot establish a connection with aWFD-compatible apparatus or a normal Wi-Fi apparatus and cause theWFD-compatible apparatus or normal Wi-Fi apparatus to newly participatein the WFD NW.

(Normal Wi-Fi)

The normal Wi-Fi method is a wireless communication system defined byWi-Fi Alliance, and is a wireless communication system different fromthe WFD method. As with the WFD method, the normal Wi-Fi method is awireless communication system for executing a wireless communicationaccording to IEEE standard 802.11 and standards conforming thereto(e.g., 802.11a, 11b, 11g, 11n, etc.). That is, in terms of communicationstandard, the WFD method and the normal Wi-Fi method are the same.

However, as described above, the WFD method is a wireless communicationsystem for executing a wireless communication not via an AP, whereas thenormal Wi-Fi method is a wireless communication system for executing awireless communication via an AP. Further, the WFD method is a wirelesscommunication system having a G/O negotiation scheme, whereas the normalWi-Fi method is a wireless communication system not having that scheme.Further, as described above, the data for connecting with the WFD methodincludes the Provision Discovery Request signal and the ProvisionDiscovery Response signal, whereas the data for connecting with thenormal Wi-Fi method does not include these signals. Further, the WFDmethod is a wireless communication system allowing selective operationin any state of three states (i.e., G/O state, CL state, device state),whereas the normal Wi-Fi method is a wireless communication system notallowing this type of selective operation. The WFD method and the normalWi-Fi method differ in these points.

The normal Wi-Fi apparatus establishes a connection with an AP byexecuting, with an AP (e.g., the AP 4A), a wireless communication of thedata for connecting with the normal Wi-Fi method. Thereby, the normalWi-Fi apparatus can participate in a wireless network (called “normalWi-Fi NW” below) formed by the AP. At this stage, the normal Wi-Fiapparatus does not execute a G/O negotiation, and does not selectivelydetermine operation in the G/O state or the CL state. The normal Wi-Fiapparatus can execute a wireless communication for the target data, viathe AP, with another apparatus belonging to the normal Wi-Fi NW.Moreover, in case of establishing a connection with the normal Wi-Fiapparatus, the AP describes the MAC address of the normal Wi-Fiapparatus in a management list of the AP.

Moreover, the normal Wi-Fi NW is a wireless network constructed in anenvironment where an AP can be installed, such as a LAN in a company, aLAN in a household, etc. In general terms, the normal Wi-Fi NW is awireless network that is to remain formed constantly. In contrast, dueto not requiring an AP, the WFD NW is a wireless network constructedfor, e.g., executing a temporary wireless communication between a pairof WFD-compatible apparatuses. In general terms, the WFD NW is awireless network that is to be formed temporarily. Thus, in the presentembodiment, it is assumed that the normal Wi-Fi NW is a wireless networkthat is to remain formed constantly, and the WFD NW is a wirelessnetwork that is to be formed temporarily.

(Process for MFP 10 and Portable Terminal 50 to Belong to WirelessNetwork; FIG. 2)

Next, the contents of a process executed by the MFP 10 and the portableterminal 50 will be described. First, the contents of a process for theMFP 10 and the portable terminal 50 to belong to a wireless network(i.e., the normal Wi-Fi NW, the WFD NW) will be described with referenceto FIG. 2.

(Process for Belonging to Normal Wi-Fi NW)

In case of wishing to cause the portable terminal 50 to participate inthe normal Wi-Fi NW formed by the AP 4A, the user of the portableterminal 50 operates the operating unit 52, executing a normal Wi-Ficonnection instruction. The normal Wi-Fi connection instruction includese.g., selecting an item indicating “wireless LAN” from a menu screendisplayed on the displaying unit 54, then selecting, from a networkselection screen displayed on the displaying unit 54 (e.g., from amongan item indicating “normal Wi-Fi NW”, an item indicating “WFD NW”), theitem indicating “normal Wi-Fi NW”. The user further executes apredetermined instruction in the AP 4A for establishing a connection.

When the normal Wi-Fi connection instruction and the predeterminedinstruction have been executed, the controller 70 of the portableterminal 50 executes a wireless communication, with the AP 4A, of thedata for connecting with the normal Wi-Fi method, this wirelesscommunication being executed via the wireless LAN I/F 60 by using thenormal Wi-Fi MAC of the portable terminal 50. Moreover, the controller70 can know a channel value (e.g., one value among 1 to 14ch) currentlybeing used by the AP 4A, and executes the wireless communication, withthe AP 4A, of the data for connecting by using that channel value.Further, at the stage of the wireless communication of the data forconnecting, the controller 70 receives wireless setting information fromthe AP 4A. The wireless setting information is information currentlybeing used in the normal Wi-Fi NW formed by the AP 4A. Moreover, below,the wireless setting information used in the normal Wi-Fi NW is called“normal Wi-Fi WSI (an abbreviation of Wireless Setting Information)”.

The normal Wi-Fi WSI includes an SSID (an abbreviation of Service SetIdentifier), a BSSID (an abbreviation of Basic Service Set Identifier),an authentication method, an encryption method, and a password. The SSIDand BSSID are identification information for identifying the normalWi-Fi NW. More specifically, the SSID is a network identifier of thenormal Wi-Fi NW, and the BSSID is a MAC address of an AP (the AP 4A inthe example of FIG. 2). In FIG. 2, a specific value of the SSID and aspecific value of the BSSID are expressed respectively as “X1”, “Y1”.The authentication method, encryption method, and password areinformation for executing an authentication of the apparatus, executingan encryption of data, etc. in the normal Wi-Fi NW.

When a wireless communication of the normal Wi-Fi WSI is executed andthen a wireless communication for authentication is executed between theAP 4A and the portable terminal 50, a connection is established betweenthe AP 4A and the portable terminal 50. Thereby, the portable terminal50 can participate in the normal Wi-Fi NW formed by the AP 4A. Moreover,when the portable terminal 50 participates in the normal Wi-Fi NW, thecontroller 70 stores, in the memory 74, an association of the normalWi-Fi WSI, and normal belonging information indicating that the portableterminal 50 belongs to the normal Wi-Fi NW.

As with the case of the portable terminal 50, the user of the MFP 10operates the operating unit 12, executing the normal Wi-Fi connectioninstruction, and executes the predetermined instruction in the AP 4A.Thereby, by using the normal Wi-Fi MAC of the MFP 10, the controller 30of the MFP 10 executes a wireless communication with the AP 4A of thedata for connecting with the normal Wi-Fi method via the wireless LANI/F 20.

When a wireless communication of the normal Wi-Fi WSI is executed andthen a wireless communication for authentication is executed between theAP 4A and the MFP 10, a connection is established between the AP 4A andthe MFP 10. Thereby, the MFP 10 can participate in the normal Wi-Fi NWformed by the AP 4A. Consequently, a state is formed in which the MFP 10and the portable terminal belong to the same normal Wi-Fi NW.Consequently, by using the normal Wi-Fi NW, the MFP 10 and the portableterminal 50 can execute a wireless communication for the target data viathe AP 4A. Moreover, when the MFP 10 participates in the normal Wi-FiNW, the controller 30 stores, in the memory 34, an association of thenormal Wi-Fi WSI, and normal belonging information indicating that theMFP 10 belongs to the normal Wi-Fi NW.

Moreover, the MFP 10 and the portable terminal 50 may each alsoparticipate in a normal Wi-Fi NW formed by an AP 4B (see FIG. 1)different from the AP 4A. Further, the MFP 10 may participate in thenormal Wi-Fi NW formed by the AP 4A, and the portable terminal 50 mayparticipate in the normal Wi-Fi NW formed by the AP 4B. In this case,the MFP 10 and the portable terminal 50 belong to different normal Wi-FiNWs, and consequently cannot execute a wireless communication for thetarget data by using the normal Wi-Fi NW.

(Process for Belonging to WFD NW)

In case of wishing to form a WFD NW to which both the MFP 10 and theportable terminal 50 belong, the user operates the operating unit 52 ofthe portable terminal 50 to execute a WFD connection instruction. TheWFD connection instruction includes e.g., selecting an item indicating“wireless LAN” from a menu screen displayed on the displaying unit 54,and then selecting an item indicating “WFD NW” from a network selectionscreen displayed on the displaying unit 54. Further, as in the case ofthe portable terminal 50, the user operates the operating unit 12 of theMFP 10 to execute the WFD connection instruction.

The MFP 10 and the portable terminal 50 execute a G/O negotiation.Specifically, the controller 30 of the MFP 10 executes the G/Onegotiation, via the wireless LAN I/F 20, by using the WFD MAC of theMFP 10. Further, the controller 70 of the portable terminal 50 executesthe G/O negotiation, via the wireless LAN I/F 60, by using the WFD MACof the portable terminal 50.

In the G/O negotiation, the controller 30 of the MFP 10 sendsinformation (more specifically, Intent value) indicating G/O priority ofthe MFP 10 to the portable terminal 50, and receives information fromthe portable terminal 50 indicating G/O priority of the portableterminal 50. Further, the controller 70 of the portable terminal 50sends the information indicating G/O priority of the portable terminal50 to the MFP 10, and receives information from the MFP 10 indicatingG/O priority of the MFP 10. The G/O priority of the MFP 10 is an indexindicating the degree to which the MFP 10 should assume the G/O state,and is predetermined in the MFP 10. Similarly, the G/O priority of theportable terminal is an index indicating the degree to which theportable terminal 50 should assume the G/O state, and is predeterminedin the portable terminal 50.

The controller 30 of the MFP 10 compares the G/O priority of the MFP 10and the G/O priority of the portable terminal 50, determines that theapparatus with higher priority assumes the G/O state, and determinesthat the apparatus with lower priority assumes the CL state. Thecontroller 70 of the portable terminal 50 determines the state of theportable terminal 50 by using the same method as the MFP 10. In theexample of FIG. 2, it is determined that the MFP 10 is to assume the G/Ostate, and the portable terminal 50 is to assume the CL state.

In the WFD method, the G/O apparatus prepares the wireless settinginformation used in the WFD NW. Moreover, below, the wireless settinginformation used in the WFD NW is called “WFD WSI”. As with the normalWi-Fi WSI, the WFD WSI includes an SSID, a BSSID, an authenticationmethod, an encryption method, and a password. Except for the point thatinformation in the WFD WSI is information to be used in the WFD NW, theinformation included in the WFD WSI is the same as the information inthe normal Wi-Fi WSI. Moreover, the BSSID included in the WFD WSI is theMAC address of the G/O apparatus.

In the example of FIG. 2, since the MFP 10 is the G/O apparatus, thecontroller 30 of the MFP 10 prepares the WFD WSI. Specifically, thecontroller 30 prepares the SSID by preparing a predetermined SSID or bynewly creating an SSID. The controller 30 prepares the WFD MAC of theMFP 10 as the BSSID. In FIG. 2, a specific value of the SSID and aspecific value of the BSSID are expressed respectively as “X2”, “Y2”.The controller 30 prepares the predetermined authentication method andencryption method. The controller 30 prepares the password by preparinga predetermined password or by newly creating a password.

The controller 30 further determines a channel value to be used in theWFD NW. The wireless LAN I/F 20 of the MFP 10 has the constraint that achannel value for wireless communication used by the normal Wi-Fi MAC,and a channel value for wireless communication used by the WFD MAC mustbe identical. Consequently, in a state where the MFP 10 belongs to thenormal Wi-Fi NW, in a case where the WFD NW is to be formed in which theMFP 10 is the G/O apparatus, the controller 30 determines, as thechannel value to be used in the WFD NW, a value which is identical tothe channel value currently being used in the normal Wi-Fi NW. On theother hand, in a state where the MFP 10 does not belong to the normalWi-Fi NW, in the case where the WFD NW is to be formed in which the MFP10 is the G/O apparatus, the controller 30 determines e.g., apredetermined value as the channel value to be used in the WFD NW.Moreover, the wireless LAN I/F 60 of the portable terminal 50 also hasthe same constraint as the wireless LAN I/F 20 of the MFP 10.

Next, by using the WFD MAC of the MFP 10, the controller 30 of the MFP10 executes, with the portable terminal 50 via the wireless LAN I/F 20,a wireless communication of the data for connecting with the WFD method.At the stage of the wireless communication of the data for connecting,the controller 30 sends the prepared WFD WSI to the portable terminal50.

When the wireless communication of the WFD WSI is executed, and then awireless communication for authentication is executed between the MFP 10and the portable terminal 50, a connection is established between theMFP 10 and the portable terminal 50. Thereby, the MFP 10 can form theWFD NW as the G/O apparatus, and the portable terminal 50 canparticipate in the WFD NW as the CL apparatus. That is, a state isformed in which the MFP 10 and the portable terminal 50 belong to thesame WFD NW. Consequently, the MFP 10 and the portable terminal 50 canexecute a wireless communication for the target data by using the WFD NWwithout passing via the AP 4A.

The controller 30 of the MFP 10 stores, in the memory 34, an associationof WFD belonging information indicating that the MFP 10 belongs to theWFD NW, WFD state information indicating current state (i.e., G/O state)of the MFP 10, and the WFD WSI. The controller 30 further creates amanagement list in the memory 34, and describes the WFD MAC of theportable terminal 50 in the management list. Further, the controller 70of the portable terminal 50 stores, in the memory 74, an association ofWFD belonging information indicating that the portable terminal 50belongs to the WFD NW, WFD state information indicating current state(i.e., CL state) of the portable terminal 50, and the WFD WSI.

Moreover, the MFP 10 may also execute a G/O negotiation with anapparatus (e.g., the PCs 6A, 6B (see FIG. 1)) different from theportable terminal 50, to belong to a WFD NW. Further, the portableterminal 50 may also execute a G/O negotiation with an apparatusdifferent from the MFP 10, to belong to a WFD NW.

(Application Process of Portable Terminal 50; FIG. 3)

Next, the contents of a process executed by the controller 70 of theportable terminal 50 according to the application 76 will be describedwith reference to FIG. 3. In case of wishing to cause the MFP 10 toexecute the print function or the scan function, the user of theportable terminal 50 operates the operating unit 52, activating theapplication 76. Next, the user selects an item indicating apredetermined function (e.g., an item indicating “print”, an itemindicating “scan”) from a function selection screen displayed on thedisplaying unit 54. In case of selecting the print function, the userfurther specifies data (i.e., print data) that represents an image of aprint target.

The NFC I/F 62 of the portable terminal 50 sends detecting radio wavesfor detecting an apparatus (e.g., the MFP 10) capable of executing anNFC communication. Further, the NFC OF 22 of the MFP 10 sends detectingradio waves for detecting an apparatus (e.g., the portable terminal 50)capable of executing an NFC communication. When the user brings theportable terminal 50 close to the MFP 10, distance between the portableterminal 50 and the MFP 10 becomes less than a distance (e.g., 10cm)where the radio waves reach one another. In this case, one of the MFP 10and the portable terminal 50 receives the detecting radio waves sentfrom the other, and sends response waves. Consequently, an NFCcommunication session is established between the MFP 10 and the portableterminal 50. In this case, the controller 70 executes a flowchart ofFIG. 3.

Further, in case of selecting the scan function, the user brings theportable terminal 50 close to the MFP 10 without specifying data.Consequently, an NFC communication session is established between theMFP 10 and the portable terminal 50. In this case, also, the controller70 executes the flowchart of FIG. 3.

In S10, by using the NFC communication session, an identificationinformation sending unit 86 sends a demanding command to the MFP 10 viathe NFC I/F 62. The demanding command includes function informationindicating a function selected by the user (i.e., print or scan). Incase the portable terminal 50 belongs to the normal Wi-Fi NW, thedemanding command further includes the SSID and the BSSID included inthe normal Wi-Fi WSI in the memory 74. Further, in case the portableterminal 50 belongs to the WFD NW, the demanding command furtherincludes the SSID and the BSSID included in the WFD WSI in the memory74. That is, the demanding command may include two sets of SSID andBSSID (i.e., the SSID and the BSSID of the normal Wi-Fi NW, and the SSIDand the BSSID of the WFD NW), may include only one set of SSID andBSSID, or may not include the SSID and the BSSID.

Moreover, in the present embodiment, the demanding command does notinclude information indicating which network is the network for whichthe SSID and the BSSID are the ID. In this type of configuration, also,the MFP 10 can appropriately determine whether the MFP 10 and theportable terminal 50 belong to the same wireless network (see S52, S56of FIG. 4). However, in a variant, the SSID and the BSSID of the normalWi-Fi NW, and information indicating the normal Wi-Fi NW may beassociated in the demanding command, or the SSID and the BSSID of theWFD NW, and information indicating the WFD NW may be associated in thedemanding command.

Upon receiving the demanding command from the portable terminal 50, theMFP 10 sends normal usage information (see S54 of FIG. 4), WFD usageinformation (see S58), the WFD WSI (see S70), or NG information (seeS68) to the portable terminal 50 by using the NFC communication session.

In case of receiving the NG information from the MFP 10 via the NFC I/F62, the controller 70 determines YES in S12, and the process proceeds toS14. In S14, the controller 70 causes an error screen, indicating that aprint or scan cannot be executed, to be displayed on the displaying unit54. Thereby, the user can learn that a wireless communication of theprint data or scan data cannot be executed. When S14 ends, the processof FIG. 3 ends.

Further, in case of receiving the WFD WSI from the MFP 10, a settinginformation receiving unit 87 determines NO in S12, then determines YESin S16, and the process proceeds to S18. The WFD WSI received here isthe wireless setting information currently being used in the WFD NW inwhich the MFP 10 is the G/O apparatus.

Further, in case of receiving the normal usage information or the WFDusage information from the MFP 10, the controller 70 determines NO inS12, then determines NO in S16, and the process proceeds to S28. Thenormal usage information received here is information for instructingthe portable terminal 50 to use the normal Wi-Fi NW. The situation inwhich the normal usage information is received is a situation in whichthe MFP 10 and the portable terminal 50 belong to the same normal Wi-FiNW (see YES in S52 of FIG. 4). Further, the WFD usage information isinformation for instructing the portable terminal 50 to use the WFD NW.The situation in which the WFD usage information is received is asituation in which the MFP 10 and the portable terminal 50 belong to thesame WFD NW (see YES in S56 of FIG. 4).

In S18, a seceding control unit 88 determines whether or not theportable terminal 50 currently belongs to the normal Wi-Fi NW. Theseceding control unit 88 determines that the portable terminal 50currently belongs to the normal Wi-Fi NW (YES in S18) in a case wherethe normal belonging information is being stored in the memory 74, andproceeds to S20. The seceding control unit 88 determines that theportable terminal 50 does not currently belong to the normal Wi-Fi NW(NO in S18) in a case where the normal belonging information is notbeing stored in the memory 74, S20 is skipped, and the process proceedsto S26.

Below, a normal Wi-Fi NW to which the portable terminal 50 is belongingis described as “normal Wi-Fi NW (terminal)”. Similarly, a WFD NW towhich the portable terminal 50 is belonging is described as “WFD NW(terminal)”. In particular, a WFD NW in which the portable terminal 50is the G/O apparatus, and a WFD NW in which the portable terminal 50 isthe CL apparatus are described respectively as “WFD NW (terminal=G/O)”and “WFD NW (terminal=CL)”. Similarly, descriptions for the MFP 10,also, are “normal Wi-Fi NW (MFP)”, “WFD NW (MFP)”, “WFD NW (MFP=G/O)”,“WFD NW (MFP=CL)”.

In S20, the seceding control unit 88 causes the portable terminal 50 tosecede from the normal Wi-Fi NW (terminal). Specifically, the secedingcontrol unit 88 sends, via the wireless LAN I/F 60, a seceding signal(e.g., a Disassociation signal) to the AP (e.g., the AP 4A) forming thenormal Wi-Fi NW (terminal), disconnecting the connection with the AP.Moreover, even if S20 is executed, the controller 70 does not erase thenormal belonging information and the normal Wi-Fi WSI from the memory74. This is because the portable terminal 50 re-participates in thenormal Wi-Fi NW in S32 (to be described).

Moreover, in S26 (to be described), the portable terminal 50participates in the WFD NW (MFP=G/O), but uses the normal Wi-Fi MAC atthis juncture. If S20 is not executed in the case of YES in S18, theportable terminal 50 is belonging to the normal Wi-Fi NW (terminal) byusing the normal Wi-Fi MAC. Consequently, the portable terminal 50cannot use the normal Wi-Fi MAC in S26, and therefore cannot participatein the WFD NW (MFP=G/O). In view of these circumstances, in S20, theportable terminal 50 secedes from the normal Wi-Fi NW (terminal),forming a state in which the normal Wi-Fi MAC is not being used.Thereby, in S26, the portable terminal 50 can appropriately participatein the WFD NW (MFP=G/O) by using the normal Wi-Fi MAC. When S20 ends,the process proceeds to S26.

In S26, by using the normal Wi-Fi MAC, a participating control unit 89executes a wireless communication with the MFP 10 (i.e., the G/Oapparatus), via the wireless LAN I/F 60, of the data for connecting withthe normal Wi-Fi method. At this juncture, the participating controlunit 89 uses the WFD WSI received in S16. That is, the participatingcontrol unit 89 sends the WFD WSI to the MFP 10, and executes acommunication for authentication. Consequently, a connection between theportable terminal 50 and the MFP 10 is established. Thereby, theportable terminal 50 can participate in the WFD NW (MFP=G/O).

As described above, in S26, by using the normal Wi-Fi MAC, the portableterminal 50 participates in the WFD NW (MFP=G/O) according to the normalWi-Fi method (i.e., executes a wireless communication of the data forconnecting with the normal Wi-Fi method). Consequently, the portableterminal 50 participates in the WFD NW (MFP=G/O) without executing a G/Onegotiation and, further, without shifting to the CL state. In otherwords, the portable terminal 50 participates in the WFD NW (MFP=G/O) asa normal Wi-Fi apparatus (i.e., a legacy apparatus).

Moreover, it is possible, when S26 is executed, that the portableterminal 50 is belonging to the WFD NW (terminal) by using the WFD MAC.In this case, the portable terminal 50 may secede from the WFD NW(terminal) when S26 is executed. The reason therefore is as follows.That is, as described above, the wireless LAN I/F 60 of the portableterminal 50 has the constraint that the channel value corresponding tothe normal Wi-Fi MAC of the portable terminal 50, and the channel valuecorresponding to the WFD MAC of the portable terminal 50 must beidentical. Thereupon, in S26, the participating control unit 89participates in the WFD NW (MFP=G/O) by using the normal Wi-Fi MAC, butat this juncture uses a channel value that is currently being used inthe WFD NW (MFP=G/O) (called “target channel value” below). That is, thechannel value corresponding to the normal Wi-Fi MAC becomes the targetchannel value.

The aforementioned constraint of the wireless LAN I/F 60 is met in casethe channel value currently being used in the WFD NW (terminal) (i.e.,the channel value corresponding to the WFD MAC of the portable terminal50), and the target channel value currently being used in the WFD NW(MFP=G/O) (i.e., the channel value corresponding to the normal Wi-Fi MACof the portable terminal 50), are identical. Consequently, the portableterminal 50 can participate in the WFD NW (MFP=G/O) while maintainingthe state of belonging to the WFD NW (terminal). That is, in case thevalues of the two channels are identical, the participating control unit89 does not cause the portable terminal 50 to secede from the WFD NW(terminal).

On the other hand, in case the values of the two channels are notidentical, the participating control unit 89 changes the channel valuecorresponding to the WFD MAC of the portable terminal 50 to the targetchannel value at the time of causing the portable terminal 50 toparticipate in the WFD NW (MFP=G/O), so that the aforementionedconstraint of the wireless LAN I/F 60 is met. In this case, the portableterminal 50 no longer uses the channel value that is actually being usedin the WFD NW (terminal), and consequently the portable terminal 50secedes from the WFD NW (terminal), and shifts to the device state. Thatis, in the case where the values of the two channels are not identical,the participating control unit 89 causes the portable terminal 50 tosecede from the WFD NW (terminal).

Moreover, in S26, in case the portable terminal 50, which is the G/Oapparatus, secedes from the WFD NW (terminal=G/O), the controller 70deletes the WFD belonging information, the WFD state information, andthe WFD WSI from the memory 74. This is because in S32 (to be described)the portable terminal 50 cannot re-participate in the WFD NW due to theWFD NW (terminal=G/O) having been dissolved. On the other hand, in S26,in case the portable terminal 50, which is the CL apparatus, secedesfrom the WFD NW (terminal=CL), the controller 70 does not erase the WFDbelonging information, the WFD state information, and the WFD WSI fromthe memory 74. This is because even if the portable terminal 50 hasseceded from the WFD NW (terminal=CL), in S32 (to be described) theportable terminal 50 could re-participate in the WFD NW as the WFD NWmay not have been dissolved. When S26 ends, the process proceeds to S28.

Next, the contents of a process of S28 will be described. As describedabove, a situation in which S28 is executed is: a situation where thenormal usage information is received from the MFP 10 (NO in S16); asituation where the WFD usage information is received from the MFP 10(NO in S16); or a situation where the portable terminal 50 participatesin the WFD NW (MFP=G/O) (S26).

In the situation where the normal usage information is received from theMFP 10, the MFP 10 and the portable terminal 50 belong to the samenormal Wi-Fi NW (described as “normal Wi-Fi NW (MFP, terminal)” below).In this type of situation, in S28, a communication execution unit 83executes a wireless communication for the target data with the MFP 10via the wireless LAN I/F 60 by using the normal Wi-Fi NW (MFP,terminal). Specifically, in case the print function was selected by theuser, the communication execution unit 83 sends a print command andprint data (e.g., data specified by the user) to the MFP 10.Consequently, the MFP 10 executes a print according to the print data.Further, in case the scan function was selected by the user, thecommunication execution unit 83 sends a scan command to the MFP 10.Consequently, the MFP 10 executes a scan of a document, creating scandata, and sends the scan data to the portable terminal 50. In this case,the communication execution unit 83 receives the scan data from the MFP10. The controller 70 stores the scan data in the memory 74 and,further, causes an image represented by the scan data to be displayed onthe displaying unit 54.

In the situation where the WFD usage information is received from theMFP 10, the MFP 10 and the portable terminal 50 belong to the same WFDNW (described as “WFD NW (MFP, terminal)” below). In this type ofsituation, in S28, the communication execution unit 83 executes awireless communication for the target data with the MFP 10 via thewireless LAN OF 60 by using the WFD NW (MFP, terminal).

Further, in the situation where the portable terminal 50 participates inthe WFD NW (MFP=G/O), in S28 the communication execution unit 83executes a wireless communication for the target data with the MFP 10via the wireless LAN I/F 60 by using the WFD NW (MFP=G/O). When S28ends, the process proceeds to S30.

In S30, the controller 70 determines whether or not the portableterminal 50 has seceded from at least one of the normal Wi-Fi NW(terminal) and the WFD NW (terminal). Specifically, in case S20 has beenexecuted, the controller 70 determines YES in S30, and proceeds to S32.Further, the controller 70 also determines YES in S30 and proceeds toS32 in case the portable terminal 50 has seceded from the WFD NW(terminal) as a result of the process of S26. In case of determining NOin S30, the controller 70 skips S32, and ends the process of FIG. 3.

In S32, the controller 70 attempts to cause the portable terminal 50 toagain belong the wireless network from which the portable terminal 50seceded. Moreover, even in case the portable terminal 50 seceded fromthe WFD NW (terminal=G/O) in S26, YES is determined in S30, and theprocess proceeds to S32. However, in this case, the WFD NW(terminal=G/O) has been dissolved, and therefore the portable terminal50 cannot again belong to the WFD NW (terminal=G/O). Consequently, incase the portable terminal 50 has seceded from the WFD NW(terminal=G/O), the controller 70 ends the process of FIG. 3 withoutexecuting any process in S32.

On the other hand, in case the portable terminal 50 seceded from thenormal Wi-Fi NW (terminal) or the WFD NW (terminal=CL) in S20 or S26, inS32 the controller 70 first sends a seceding signal, via the wirelessLAN I/F 60, to the MFP 10 which is the G/O apparatus, and disconnectsthe connection with the MFP 10. Thereby, the portable terminal 50 cansecede from the WFD NW (MFP=G/O). That is, the normal Wi-Fi MAC of theportable terminal 50 assumes a state of not being used.

For example, in case the portable terminal 50 seceded from the normalWi-Fi NW (terminal) in S20, in S32 the controller 70 executes a wirelesscommunication, with the AP forming that normal Wi-Fi NW, of the data forconnecting with the normal Wi-Fi method, this wireless communicationbeing executed via the wireless LAN I/F 60 by using the normal Wi-FiMAC. At this juncture, the controller 70 uses the normal Wi-Fi WSI thatis being maintained in the memory 74. Consequently, a connection isestablished between the portable terminal 50 and the AP, and theportable terminal 50 can re-participate in the normal Wi-Fi NW.

Further, e.g., in case the portable terminal 50 seceded from the WFD NW(terminal=CL) in S26, in S32 the controller 70 uses the WFD MAC toexecute, via the wireless LAN OF 60, a wireless communication, with theG/O apparatus forming the WFD NW, of the data for connecting with theWFD method. At this juncture, the controller 70 uses the WFD WSI that isbeing maintained in the memory 74. Consequently, a connection isestablished between the portable terminal 50 and G/O apparatus, and theportable terminal 50 can re-participate in the WFD NW.

Moreover, in case the portable terminal 50 seceded from the WFD NW(terminal=CL) in S26, a number of CL apparatuses belonging to the WFD NWmay become zero. In this case, the portable terminal 50 cannotre-participate in the WFD NW in S32 because the WFD NW has beendissolved. In this type of situation, the controller 70 deletes the WFDbelonging information, the WFD state information, and the WFD WSI fromthe memory 74. When S32 ends, the process of FIG. 3 ends.

In the present embodiment in, e.g., a situation where the portableterminal 50 belongs to both the normal Wi-Fi NW (terminal) and the WFDNW (terminal), in S20 the portable terminal 50 secedes from the normalWi-Fi NW (terminal) and, in S26, participates in the WFD NW (MFP=G/O) asa normal Wi-Fi apparatus (i.e., legacy apparatus) by using the normalWi-Fi MAC. Instead, adoption of a configuration (called “configurationof the comparative example” below) can be considered in which theportable terminal 50 secedes from the WFD NW (terminal) in S20 and, inS26, participates in the WFD NW (MFP=G/O) as a CL apparatus by using theWFD MAC. However, in the configuration of the comparative example, thenumber of CL apparatuses belonging to the WFD NW may become zero whenthe portable terminal 50 secedes from the WFD NW (terminal), andconsequently the WFD NW may be dissolved. In this case, the portableterminal 50 cannot re-participate in the WFD NW.

By contrast, in the present embodiment, the normal Wi-Fi NW is notdissolved even if the portable terminal 50 secedes from the normal Wi-FiNW (terminal) (S20), and consequently the portable terminal 50 canre-participate in the normal Wi-Fi NW (S32). Thus, according to thepresent embodiment, the portable terminal 50 can be caused toparticipate in the original wireless network more appropriately than inthe configuration of the comparative example. Moreover, in a variant,the configuration of the comparative example may be adopted.

(Communication Process of MFP 10; FIG. 4)

Next, the contents of a communication process executed by the controller30 of the MFP 10 will be described with reference to FIG. 4. In S50, anidentification information receiving unit 41 monitors whether thedemanding command (see S10 of FIG. 3) is received from the portableterminal 50. In case the demanding command is received from the portableterminal 50 via the NFC I/F 22, the identification information receivingunit 41 determines YES in S50, and the process proceeds to S52.

In S52, the selection unit 42 determines whether or not the MFP 10 andthe portable terminal 50 belong to the same normal Wi-Fi NW. Asdescribed above, in case the MFP 10 belongs to the normal Wi-Fi NW(MFP), the memory 34 is storing an association of the normal belonginginformation and the normal Wi-Fi WSI. In case the normal belonginginformation is not being stored in the memory 34, the selection unit 42determines that the MFP 10 and the portable terminal 50 do not belong tothe same normal Wi-Fi NW (NO in S52), and the process proceeds to S56.

In case the normal belonging information is being stored in the memory34, the selection unit 42 further executes the following determinationprocess in S52. In case the portable terminal 50 does not belong to anyof the normal Wi-Fi NW and the WFD NW, the demanding command does notinclude even one set of SSID and BSSID. In case the demanding commanddoes not include even one set of SSID and BSSID, the selection unit 42determines that the MFP 10 and the portable terminal 50 do not belong tothe same normal Wi-Fi NW (NO in S52), and the process proceeds to S56.

Further, in case one or more sets of SSID and BSSID are included in thedemanding command, the selection unit 42 determines whether or not,among the one or more sets of SSID and BSSID, one set of SSID and BSSIDis present which is identical to the SSID and the BSSID of the normalWi-Fi NW in the memory 34. In case of determining that the one set ofSSID and BSSID is not present, the selection unit 42 determines that theMFP 10 and the portable terminal 50 do not belong to the same normalWi-Fi NW (NO in S52), and the process proceeds to S56. On the otherhand, in case of determining that the one set of SSID and BSSID ispresent, the selection unit 42 determines that the MFP 10 and theportable terminal 50 belong to the same normal Wi-Fi NW (YES in S52),and the process proceeds to S54. Thereby, the selection unit 42 selectsonly the normal Wi-Fi NW (MFP, terminal).

As described above, in S52 the selection unit 42 determines, by usingboth the SSID and the BSSID, whether or not the MFP 10 and the portableterminal 50 belong to the same normal Wi-Fi NW. A reason for executingboth the determination of whether SSIDs are identical and thedetermination of whether BSSIDs are identical is as follows.

For example, a situation is assumed in which a first AP (e.g., the AP4A) forms a first normal Wi-Fi NW, and a second AP (e.g., the AP 4B)different from the first AP forms a second normal Wi-Fi NW. In thiscase, the BSSID of the first normal Wi-Fi NW is the MAC address of thefirst AP, and the BSSID of the second normal Wi-Fi NW is the MAC addressof the second AP. Since the MAC address is a unique value, the BSSID ofthe first normal Wi-Fi NW and the BSSID of the second normal Wi-Fi NWare different. However, the SSID is a value that is set at will by theAP or the user. Therefore, the SSID of the first normal Wi-Fi NW and theSSID of the second normal Wi-Fi NW may be the same. Consequently, if aconfiguration is adopted in which the determination of whether SSIDs areidentical is executed but the determination of whether BSSIDs areidentical is not executed (e.g., if a configuration is adopted in whichthe BSSID is not included in the demanding command), the selection unit42 may determine that the MFP 10 and the portable terminal 50 belong tothe same normal Wi-Fi NW, even though the MFP 10 belongs to the firstnormal Wi-Fi NW and the portable terminal 50 belongs to the secondnormal Wi-Fi NW. However, the MFP 10 and the portable terminal 50 cannotexecute a communication for the target data unless the first AP and thesecond AP unless are connected by a wire. That is, in case the twoBSSIDs are not identical even though the two SSIDs are identical, asituation may occur in which the MFP 10 and the portable terminal 50cannot execute a communication for the target data. In order to preventsuch a situation from occurring, the selection unit 42 executes both thedetermination of whether SSIDs are identical and the determination ofwhether BSSIDs are identical.

Further, known APs include an AP capable of simultaneously forming aplurality of normal Wi-Fi NWs. For example, a situation is assumed inwhich one AP (e.g., the AP 4A) is forming the first normal Wi-Fi NW andthe second normal Wi-Fi NW. In this case, the SSID of the first normalWi-Fi NW and the SSID of the second normal Wi-Fi NW are different,whereas the BSSID of the first normal Wi-Fi NW (i.e., MAC address of theAP) and the BSSID of the second normal Wi-Fi NW (i.e., MAC address ofthe AP) are the same. Consequently, if a configuration is adopted inwhich the determination of whether BSSIDs are identical is executed, butthe determination of whether SSIDs are identical is not executed (e.g.,if a configuration is adopted in which the SSID is not included in thedemanding command), the selection unit 42 may determine that the MFP 10and the portable terminal 50 belong to the same normal Wi-Fi NW, eventhough the MFP 10 belongs to the first normal Wi-Fi NW and the portableterminal 50 belongs to the second normal Wi-Fi NW. In order to preventsuch a situation from occurring, the selection unit 42 executes both thedetermination of whether SSIDs are identical and the determination ofwhether BSSIDs are identical.

Moreover, as with S52, in S56 (to be described), also, the selectionunit 42 executes both the determination of whether SSIDs are identicaland the determination of whether BSSIDs are identical. According to thepresent embodiment, because the selection unit 42 executes both thedetermination of whether SSIDs are identical and the determination ofwhether BSSIDs are identical, the selection unit 42 can appropriatelydetermine whether or not the MFP 10 and the portable terminal 50 belongto the same normal Wi-Fi NW, and, further, can appropriately determinewhether or not the MFP 10 and the portable terminal 50 belong to thesame WFD NW.

In S54, a usage information sending unit 44 sends the normal usageinformation to the portable terminal 50 via the NFC I/F 22. Thereby, theportable terminal 50 determines NO in S16 of FIG. 3, and executes awireless communication for the target data with the MFP 10 (see S28) byusing the normal Wi-Fi NW (MFP, terminal).

In S56, the selection unit 42 determines whether or not the MFP 10 andthe portable terminal 50 belong to the same WFD NW. In case the MFP 10belongs to the WFD NW (MFP), the memory 34 is storing an association ofthe WFD belonging information, the WFD state information, and the WFDWSI. In case the WFD belonging information is not being stored in thememory 34, the selection unit 42 determines that the MFP 10 and theportable terminal 50 do not belong to the same WFD NW (NO in S56), andthe process proceeds to S60.

In case the WFD belonging information is being stored in the memory 34,the selection unit 42 further executes a following determination processin S56. That is, in case not even one set of SSID and BSSID is includedin the demanding command, the selection unit 42 determines that the MFP10 and the portable terminal 50 do not belong to the same WFD NW (NO inS56), and the process proceeds to S60.

Further, in case one or more sets of SSID and BSSID are included in thedemanding command, the selection unit 42 determines whether or not,among the one or more sets of SSID and BSSID, one set of SSID and BSSIDis present which is identical to the SSID and the BSSID of the WFD NW inthe memory 34. In case of determining that the one set of SSID and BSSIDis not present, the selection unit 42 determines that the MFP 10 and theportable terminal 50 do not belong to the same WFD NW (NO in S56), andthe process proceeds to S60. On the other hand, in case of determiningthat the one set of SSID and BSSID is present, the selection unit 42determines that the MFP 10 and the portable terminal 50 belong to thesame WFD NW (YES in S56), and the process proceeds to S58. Thereby, theselection unit 42 selects only the WFD NW (MFP, terminal).

In S58, the usage information sending unit 44 sends the WFD usageinformation to the portable terminal 50 via the NFC I/F 22. Thereby, theportable terminal 50 determines NO in S16 of FIG. 3, and executes awireless communication for the target data with the MFP 10 (see S28) byusing the WFD NW (MFP, terminal). When S58 ends, the process proceeds toS80.

In the present embodiment, the selection unit 42 executes thedetermination of S52 before the determination of S56. Consequently, in asituation where the MFP 10 and the portable terminal 50 belong to thesame normal Wi-Fi NW, and the MFP 10 and the portable terminal 50 belongto the same WFD NW (called “specific situation” below), YES isdetermined in S52, and then in S54 the normal usage information is sentto the portable terminal 50. That is, in the present embodiment, aconfiguration is adopted in which, in the specific situation, acommunication for the target data is executed by using not the WFD NW(MFP, terminal), but by using the normal Wi-Fi NW (MFP, terminal). Thisprioritizing of the normal Wi-Fi NW (MFP, terminal) is because thenormal Wi-Fi NW is a wireless network that is to remain formedconstantly, and the WFD NW is a wireless network that is to be formedtemporarily.

That is, because the WFD NW is a wireless network that is to be formedtemporarily, it is likely that the WFD NW (MFP, terminal) is dissolvedbefore execution of a wireless communication for the target data, orduring a wireless communication for the target data. For example, incase the MFP 10 and the portable terminal 50 are each a CL apparatus inthe WFD NW (MFP, terminal), the WFD NW (MFP, terminal) is dissolved whena power source of a G/O apparatus (e.g., the PC 6A) is turned OFF. Bycontrast, since the normal Wi-Fi NW is a wireless network that is toremain formed constantly, it is unlikely that a power source of the APwill be turned OFF. Consequently, if the normal Wi-Fi NW (MFP, terminal)is used, it is likely that a wireless communication for the target datacan be executed appropriately. In view of these circumstances, aconfiguration is adopted in the present embodiment in which thedetermination of S52 is executed before the determination of S56, i.e.,a configuration which prioritizes the normal Wi-Fi NW (MFP, terminal) isadopted.

In case the MFP 10 and the portable terminal 50 do not belong to thesame normal Wi-Fi NW, and do not belong to the same WFD NW (in case ofNO in S56), the process proceeds to S60. In S60, the controller 30determines whether or not a current state of the MFP 10 is the CL state.In case the WFD state information is not being stored in the memory 34,i.e., in case the current state of the MFP 10 is the device state, thecontroller 30 determines that the current state of the MFP 10 is not theCL state (NO in S60), and proceeds to S62. Further, in case the WFDstate information in the memory 34 indicates the G/O state, thecontroller 30 determines that the current state of the MFP 10 is not theCL state (NO in S60), and proceeds to S62. Further, in case the WFDstate information in the memory 34 indicates the CL state, thecontroller 30 determines that the current state of the MFP 10 is the CLstate (YES in S60), and proceeds to S68.

In S62, the controller 30 determines whether or not the current state ofthe MFP 10 is the G/O state. In case the WFD state information is notbeing stored in the memory 34, i.e., in case the current state of theMFP 10 is the device state, the controller 30 determines that thecurrent state of the MFP 10 is not the G/O state (NO in S62), andproceeds to S64. In case the WFD state information in the memory 34indicates the G/O state, the controller 30 determines that the currentstate of the MFP 10 is the G/O state (YES in S62), and proceeds to S66.

In S64, the controller 30 shifts the MFP 10 to an autonomy G/O mode. Asdescribed above, when a WFD NW is to be newly formed, usually a G/Onegotiation is executed, and the G/O apparatus and the CL apparatus aredetermined. By contrast, it is determined in the autonomy G/O mode thatthe MFP 10 is to assume the G/O state without executing a G/Onegotiation. At the stage of S64, the MFP 10 is the G/O apparatus and aCL apparatus is not present. However, it could also be said that, whenS64 is executed, a WFD NW (MFP=G/O) is formed to which only the G/Oapparatus (i.e., the MFP 10) belongs. The autonomy G/O mode is a modefor maintaining operation of the MFP 10 in the G/O state. For example,in case the MFP 10 assumes the G/O state by means of G/O negotiation andforms a WFD NW (MFP=G/O), the MFP 10 will shift from the G/O state tothe device state if a CL apparatus becomes no longer present in the WFDNW (MFP=G/O) (i.e., the WFD NW (MFP=G/O) will be dissolved). Bycontrast, e.g., in case the MFP 10 assumes the G/O state by means ofautonomy G/O mode and forms a WFD NW (MFP=G/O), the MFP 10 maintains theG/O state (i.e., the WFD NW (MFP=G/O) is maintained) even if a CLapparatus becomes no longer present.

In S64, the controller 30 also prepares the WFD WSI of the WFD NW(MFP=G/O). A method whereby the controller 30 prepares the WFD WSI is asdescribed above (see the description of FIG. 2). In S64, the controller30 further stores the management list in the memory 34. However, at thisstage, there is no MAC address of any CL apparatus described in themanagement list. In S64 the controller 30 further stores, in the memory34, an association of the WFD belonging information, the WFD stateinformation indicating G/O state, and the WFD WSI. When S64 ends, theprocess proceeds to S70.

In S66, the controller 30 determines whether or not a number of CLapparatuses belonging to the WFD NW (MFP=G/O) is identical to apredetermined maximum value. In case a number of MAC addresses describedin the management list of the memory 34 is identical to the maximumvalue, the controller 30 determines YES in S66, and proceeds to S68. Onthe other hand, in case the number of MAC addresses described in themanagement list of the memory 34 is less than the maximum value, thecontroller 30 determines NO in S66, and proceeds to S70.

A first situation in which S68 is executed is a situation in which theMFP 10 and the portable terminal 50 do not belong to the same wirelessnetwork, and the MFP 10 is a CL apparatus (i.e., a situation of YES inS60). In the present embodiment, a security policy has been adopted inwhich a G/O apparatus has the right to cause another apparatus toparticipate in the WFD NW, whereas a CL apparatus does not have theright to cause another apparatus to participate in the WFD NW.Consequently, in the first situation, the MFP 10, which is a CLapparatus, cannot cause the portable terminal 50 to participate in theWFD NW (MFP=CL) (i.e., cannot send the WFD WSI of the WFD NW (MFP=CL) tothe portable terminal 50).

Further, in the present embodiment, a security policy has been adoptedin which a normal Wi-Fi apparatus does not have the right to causeanother apparatus to participate in the normal Wi-Fi NW. Consequently,in the first situation, even if the MFP 10 belongs to the normal Wi-FiNW (MFP), the MFP 10 cannot cause the portable terminal 50 toparticipate in the normal Wi-Fi NW (MFP) (i.e., cannot send the normalWi-Fi WSI of the normal Wi-Fi NW (MFP) to the portable terminal 50).

Further, a second situation in which S68 is executed is a situation inwhich the MFP 10 and the portable terminal 50 do not belong to the samewireless network and the number of CL apparatuses belonging to the WFDNW (MFP=G/O) is identical to the maximum value (i.e., a situation of YESin S66). In the second situation, the MFP 10 has the right to causeanother apparatus to participate in the WFD NW (MFP=G/O), but cannotfurther increase the CL apparatuses which are the administration target.

Consequently, in the first or the second situation, there is no meansfor the MFP 10 and the portable terminal 50 to execute a wirelesscommunication for the target data, and consequently in S68 thecontroller 30 sends the NG information to the portable terminal 50 viathe NFC I/F 22. Thereby, the portable terminal 50 determines YES in S12of FIG. 3, and displays the error screen (see S14). When S68 ends, theprocess returns to S50.

Further, in a situation in which S70 is executed, the MFP 10, which isthe G/O apparatus, has the right to cause another apparatus toparticipate in the WFD NW (MFP=G/O), and can also increase the CLapparatuses which are the administration target. Consequently, a settinginformation sending unit 45 sends the WFD WSI in the memory 34 to theportable terminal 50 via the NFC I/F 22. When S70 ends, the processproceeds to S72.

As described above, upon receiving the WFD WSI from the MFP 10, theportable terminal 50 determines YES in S16 of FIG. 3, and executes awireless communication, with the MFP 10, of the data for connecting withthe normal Wi-Fi method (see S26). In S72, the controller 30 executes awireless communication, with the portable terminal 50, of the data forconnecting via the wireless LAN I/F 20, and establishes a connectionwith the portable terminal 50. In this case, the controller 30 describesthe normal Wi-Fi MAC address of the portable terminal 50 in themanagement list of the memory 34. Thereby, the portable terminal 50 canparticipate in the WFD NW (MFP=G/O). When S72 ends, the process proceedsto S80.

Next, the contents of a process of S80 will be described. As describedabove, a situation in which S80 is executed is: the situation in whichthe normal usage information is sent to the portable terminal 50 (S54);the situation in which the WFD usage information is sent to the portableterminal 50 (S58); or the situation in which the portable terminal 50participates in the WFD NW (MFP=G/O) (S72).

In the situation in which the normal usage information is sent to theportable terminal 50, in S80 a communication execution unit 43 executesa wireless communication for the target data with the portable terminal50 via the wireless LAN I/F 20 by using the normal Wi-Fi NW (MFP,terminal). For example, the communication execution unit 43 receives theprint command and the print data from the portable terminal 50. In thiscase, the controller 30 activates a print process thread (not shown),supplying the print data to the print execution unit 16. Thereby, theprint execution unit 16 executes a print according to the print data.Further, e.g., the communication execution unit 43 receives the scancommand from the portable terminal 50. In this case, the controller 30activates a scan process thread (not shown), supplying a scan executinginstruction to the scan execution unit 18. Thereby, the scan executionunit 18 executes a scan of a document, creating scan data. Thereupon, inS80 the communication execution unit 43 sends the scan data to theportable terminal 50.

In the situation in which the WFD usage information is sent to theportable terminal 50, in S80 the communication execution unit 43executes a wireless communication for the target data with the portableterminal 50 via the wireless LAN I/F 20 by using the WFD NW (MFP,terminal).

Further, in the situation in which the portable terminal 50 participatesin the WFD NW (MFP=G/O), in S80 the communication execution unit 43executes a wireless communication for the target data with the portableterminal 50 via the wireless LAN I/F 20 by using the WFD NW (MFP=G/O).When S80 ends, the process returns to S50.

The target data (i.e., the print data or the scan data) has acomparatively large data size. Therefore, a communication speed of anNFC communication is slower than a communication speed of a WFDcommunication or a normal Wi-Fi communication. Consequently, if aconfiguration is adopted in which a wireless communication for thetarget data between the MFP 10 and the portable terminal 50 is executedby using an NFC communication, a long time is required for the wirelesscommunication for the target data. By contrast, in the presentembodiment, the MFP 10 and the portable terminal 50 execute a wirelesscommunication for the target data via the wireless LAN I/Fs 20, 60 (seeS28 of FIG. 3, S80 of FIG. 4), and consequently can execute a wirelesscommunication for the target data rapidly.

(Specific Cases)

Next, contents of specific cases realized according to the flowcharts ofFIG. 3 and FIG. 4 will be described with reference to FIG. 5 to FIG. 8.In FIG. 5 to FIG. 8, thin arrows represent NFC communication, and fatarrows represent normal Wi-Fi communication or WFD communication. Thispoint is the same in all figures from the second embodiment onward(e.g., FIG. 10, etc.).

(Case 1-1; FIG. 5)

In case 1-1, the MFP 10 and the portable terminal 50 belong to a samenormal Wi-Fi NW formed by the AP 4A. The SSID and the BSSID of thenormal Wi-Fi NW are “X1, Y1”. The MFP 10 and the portable terminal 50,further, belong to a same WFD NW. In the WFD NW, the MFP 10 is a G/Oapparatus, and the portable terminal 50 is a CL apparatus. The SSID andthe BSSID of the WFD NW are “X2, Y2”.

After the user operates the operating unit 52 of the portable terminal50, inputting a print instruction (i.e., activates the application 76,selects the print function, specifies the print data), the user bringsthe portable terminal 50 close to the MFP 10. In this case, the portableterminal 50 executes an NFC communication, and sends functioninformation indicating the print function and a demanding commandincluding “X1, Y1” and “X2, Y2” to the MFP 10 (S10 of FIG. 3).

Upon receiving the demanding command from the portable terminal 50 (YESin S50 of FIG. 4), the MFP 10 determines that the one set of SSID andBSSID “X1, Y1” in the memory 34, and the one set of the SSID andBSSID“1, Y1” in the demanding command are identical (YES in S52). Thatis, the MFP 10 determines that the MFP 10 and the portable terminal 50belong to the same normal Wi-Fi NW (MFP, terminal). Consequently, theMFP 10 sends the normal usage information to the portable terminal 50 byusing an NFC communication (S54).

Upon receiving the normal usage information from the MFP 10 (NO in S12,NO in S16 of FIG. 3), the portable terminal 50 sends the print commandand the print data to the MFP 10 via the AP 4A by using the normal Wi-FiNW (MFP, terminal) (S28).

The MFP 10 receives the print command and the print data from theportable terminal 50 via the AP 4A by using the normal Wi-Fi NW (MFP,terminal) (S80 of FIG. 4). In this case, the MFP 10 executes a printaccording to the print data.

Further, after operating the operating unit 52 of the portable terminal50 to input a scan instruction (i.e., activating the application 76 andselecting the scan function), the user brings the portable terminal 50close to the MFP 10. In this case, the portable terminal 50 executes anNFC communication, sending function information indicating the scanfunction and a demanding command including “X1, Y1” and “X2, Y2” to theMFP 10 (S10 of FIG. 3).

Upon receiving the demanding command from the portable terminal 50 (YESin S50 of FIG. 4), as with the case of printing, the MFP 10 determinesthat the MFP 10 and the portable terminal 50 belong to the same normalWi-Fi NW (MFP, terminal) (YES in S52). Consequently, the MFP 10 sendsthe normal usage information to the portable terminal 50 by using an NFCcommunication (S54).

Upon receiving the normal usage information from the MFP 10 (NO in S12,NO in S16 of FIG. 3), the portable terminal 50 sends the scan command tothe MFP 10 via the AP 4A by using the normal Wi-Fi NW (MFP, terminal)(S28).

The MFP 10 receives the scan command from the portable terminal 50 viathe AP 4A by using the normal Wi-Fi NW (MFP, terminal) (S80 of FIG. 4).In this case, the MFP 10 creates scan data, and sends the scan data tothe portable terminal 50 by using the normal Wi-Fi NW (MFP, terminal)(S80).

The portable terminal 50 receives the scan data from the MFP 10 via theAP 4A by using the normal Wi-Fi NW (MFP, terminal) (S28 of FIG. 3). Inthis case, the portable terminal 50 stores the scan data in the memory74, and causes an image represented by the scan data to be displayed onthe displaying unit 54.

According to case 1-1, in the situation in which the MFP 10 and theportable terminal 50 belong to the same normal Wi-Fi NW and the same WFDNW (i.e., the specific situation), the MFP 10 can appropriately selectonly the normal Wi-Fi NW (MFP, terminal). Consequently, the MFP 10 andthe portable terminal 50 can appropriately execute a wirelesscommunication for the target data by using the normal Wi-Fi NW (MFP,terminal).

In particular, in the specific situation, the MFP 10 preferentiallyselects not the WFD NW (MFP, terminal) that is to be constructedtemporarily, but the normal Wi-Fi NW (MFP, terminal) that is to remainconstructed constantly. Consequently, the MFP 10 and the portableterminal 50 can appropriately execute a wireless communication for thetarget data by using the normal Wi-Fi NW (MFP, terminal) which isunlikely to be dissolved.

(Case 1-2; FIG. 5)

In case 1-2, the portable terminal 50 belongs to the normal Wi-Fi NW(SSID and BSSID=“X1, Y1”) formed by the AP 4A, whereas the MFP 10 doesnot belong to the normal Wi-Fi NW. Further, the MFP 10 and the portableterminal 50 belong to the same WFD NW (MFP=G/O apparatus, portableterminal 50=CL apparatus, SSID and BSSID=“X2, Y2”).

When the MFP 10 receives the demanding command from the portableterminal 50 (YES in S50 of FIG. 4), the normal belonging information isnot being stored in the memory 34, and consequently the MFP 10determines that the MFP 10 and the portable terminal 50 do not belong tothe same normal Wi-Fi NW (NO in S52). Next, the MFP 10 determines thatthe one set of SSID and BSSID “X2, Y2” in the memory 34, and the one setof SSID and BSSID “X2, Y2” in the demanding command are identical (YESin S56). That is, the MFP 10 determines that the MFP 10 and the portableterminal 50 belong to the same WFD NW (MFP, terminal). Consequently, theMFP 10 sends the WFD usage information to the portable terminal 50 byusing an NFC communication (S58).

Upon receiving the WFD usage information from the MFP 10 (NO in S12, NOin S16 of FIG. 3), the portable terminal 50 sends the print command andthe print data directly to the MFP 10 not via another device by usingthe WFD NW (MFP, terminal) (S28).

The MFP 10 receives the print command and the print data directly fromthe portable terminal 50 not via another device by using the WFD NW(MFP, terminal) (S80 of FIG. 4). In this case, the MFP 10 executes aprint according to the print data.

According to case 1-2, in case the MFP 10 and the portable terminal 50do not belong to the same normal Wi-Fi NW, but belong to the same WFDNW, the MFP 10 can appropriately select only the WFD NW (MFP, terminal).Consequently, the MFP 10 and the portable terminal 50 can appropriatelyexecute a wireless communication for the target data not via anotherdevice by using the WFD NW (MFP, terminal).

(Case 1-3; FIG. 6)

In case 1-3, the MFP 10 and the portable terminal 50 belong to the samenormal Wi-Fi NW (SSID and BSSID=“X1, Y1”). Further, the portableterminal 50 belongs to a WFD NW (PC 6A=G/O apparatus, portable terminal50=CL apparatus, SSID and BSSID=“X3, Y3”) formed by the PC 6A, whereasthe MFP 10 does not belong to that WFD NW.

Upon receiving the demanding command from the portable terminal 50 (YESin S50 of FIG. 4), as in case 1-1 of FIG. 5, the MFP 10 determines thatthe MFP 10 and the portable terminal 50 belong to the same normal Wi-FiNW (MFP, terminal) (YES in S52). Consequently, the MFP 10 sends thenormal usage information to the portable terminal 50 by using an NFCcommunication (S54). Subsequent processes are the same as the case ofprinting of case 1-1 of FIG. 5.

According to case 1-3, in case the MFP 10 and the portable terminal 50do not belong to the same WFD NW, but belong to the same normal Wi-Fi NW(MFP, terminal), the MFP 10 can appropriately select only the normalWi-Fi NW (MFP, terminal). Consequently, the MFP 10 and the portableterminal 50 can appropriately execute a wireless communication for thetarget data by using the normal Wi-Fi NW (MFP, terminal).

(Case 1-4; FIG. 6)

In case 1-4, the portable terminal 50 belongs to the normal Wi-Fi NW(SSID and BSSID=“X1, Y1”) formed by the AP 4A, whereas the MFP 10 doesnot belong to that normal Wi-Fi NW. Further, the MFP 10 and the portableterminal 50 belong to the same WFD NW (MFP=CL apparatus, portableterminal 50=CL apparatus, SSID and BSSID=“X3, Y3”) formed by the PC 6A,which is a G/O apparatus.

Upon receiving the demanding command from the portable terminal 50 (YESin S50 of FIG. 4), as with case 1-2 of FIG. 5, the MFP 10 determinesthat the MFP 10 and the portable terminal 50 belong to the same WFD NW(MFP, terminal) (YES in S56). Consequently, the MFP 10 sends the WFDusage information to the portable terminal 50 by using an NFCcommunication (S58).

Upon receiving the WFD usage information from the MFP 10 (NO in S12, NOin S16 of FIG. 3), the portable terminal 50 sends the print command andthe print data to the MFP 10 via the PC 6A, which is the G/O apparatus,by using the WFD NW (MFP, terminal) (S28).

The MFP 10 receives the print command and the print data from theportable terminal 50 via the PC 6A, which is the G/O apparatus, by usingthe WFD NW (MFP, terminal) (S80 of FIG. 4). In this case, the MFP 10executes a print according to the print data.

According to case 1-4, in case the MFP 10 and the portable terminal 50do not belong to the same normal Wi-Fi NW, but belong to the same WFD NWin which the PC 6A is the G/O apparatus, the MFP 10 can appropriatelyselect only the WFD NW (MFP, terminal). Consequently, the MFP 10 and theportable terminal 50 can appropriately execute a wireless communicationfor the target data via the PC 6A, which is the G/O apparatus, by usingthe WFD NW (MFP, terminal).

(Case 1-5; FIG. 7)

In case 1-5, the portable terminal 50 belongs to the normal Wi-Fi NW(SSID and BSSID=“X1, Y1”) formed by the AP 4A, and to the WFD NW(portable terminal 50=CL apparatus, SSID and BSSID=“X3, Y3”) formed bythe PC 6A, which is the G/O apparatus. Moreover, in the normal Wi-Fi NW,“CH3” is being used as the channel value. The MFP 10 does not belong tothe WFD NW, but belongs to the normal Wi-Fi NW (SSID and BSSID=“X4, Y4”)formed by the AP 4B. Moreover, in the normal Wi-Fi NW, “CH4” is beingused as the channel value.

Upon receiving the demanding command from the portable terminal 50 (YESin S50 of FIG. 4), the MFP 10 determines that neither the one set ofSSID and BSSID “X1, Y1” in the demanding command or the one set of SSIDand BSSID “X3, Y3” in the demanding command are identical to the one setof SSID and BSSID “X4, Y4” in the memory 34 (NO in S52). That is, it isdetermined that the MFP 10 and the portable terminal 50 do not belong tothe same normal Wi-Fi NW. Further, since the WFD belonging informationis not being stored in the memory 34, the MFP 10 determines that the MFP10 and the portable terminal 50 do not belong to the same WFD NW (NO inS56).

Because the MFP 10 is in a state of not belonging to the WFD NW, i.e.,is in the device state, NO is determined in S60, and then NO isdetermined in S62. Thereupon, the MFP 10 shifts to the autonomy G/O modeand forms the WFD NW (MFP=G/O) (S64). At this stage, the MFP 10 preparesthe WFD WSI (SSID and BSSID=“X5, Y5”). Moreover, since the channel valuebeing used in the normal Wi-Fi NW (MFP) is “CH4”, the MFP 10 determines“CH4” as the channel value to be used in the WFD NW (MFP=G/O). This isto meet the constraint of the wireless LAN I/F 20 of the MFP 10.Thereupon, the MFP 10 sends the WFD WSI to the portable terminal 50 byusing an NFC communication (S70).

Upon receiving the WFD WSI from the MFP 10 (NO in S12, YES in S16 ofFIG. 3), the portable terminal 50 determines that the portable terminal50 belongs to the normal Wi-Fi NW (terminal) because the normalbelonging information is being stored in the memory 34 (YES in S18). Inthis case, the portable terminal 50 secedes from the normal Wi-Fi NW(terminal) (S20).

In case A, the channel value “CH3” being used in the WFD NW (terminal),and the channel value “CH4” being used in the WFD NW (MFP=G/O) areidentical. The portable terminal 50 establishes a connection with theMFP 10, which is the G/O apparatus, by using the WFD WSI (S26 of FIG.3). At this juncture, the portable terminal 50 establishes a connection,with the MFP 10, as a normal Wi-Fi apparatus (i.e., legacy apparatus) byusing the normal Wi-Fi MAC. Thereby, the portable terminal 50participates in the WFD NW (MFP=G/O) as a normal Wi-Fi apparatus. Sincethe channel value “CH3” and the channel value “CH4” are identical, whenthe portable terminal 50 participates in the WFD NW (MFP=G/O) using thechannel value “CH4”, the portable terminal 50 does not need to secedefrom the WFD NW (terminal) using the same channel value “CH3”.Thereupon, the portable terminal 50 sends the print command and theprint data to the MFP 10 not via another device by using the WFD NW(MFP=G/O) (S28).

The MFP 10 receives the print command and the print data from theportable terminal 50 not via another device by using the WFD NW (MFP,terminal) (S80 of FIG. 4). In this case, the MFP 10 executes a printaccording to the print data.

Since the portable terminal 50 has seceded from the normal Wi-Fi NW, YESis determined in S30 of FIG. 3 and, first, the portable terminal 50secedes from the WFD NW (MFP=G/O) (S32). Next, the portable terminal 50re-establishes a connection with the AP 4A by using the normal Wi-Fi MAC(S32). Thereby, the portable terminal 50 can re-participate in thenormal Wi-Fi NW.

In case B, the channel value “CH3” being used in the WFD NW (terminal),and the channel value “CH4” being used in the WFD NW (MFP=G/O) are notidentical. In this case, when the portable terminal 50 is to participatein the WFD NW (MFP=G/O) by using the channel value “CH4”, the portableterminal 50 must secede from the WFD NW (terminal) that is using thechannel value “CH3” different from the channel value “CH4”.Communication of the print command and the print data are the same ascase A.

Since the portable terminal 50 has seceded from the normal Wi-Fi NW andthe WFD NW, YES is determined in S30 of FIG. 3 and, first, the portableterminal 50 secedes from the WFD NW (MFP=G/O) (S32). Next, the portableterminal 50 re-establishes a connection with the AP 4A by using thenormal Wi-Fi MAC (S32). The portable terminal 50, further,re-establishes a connection with the PC 6A, which is the G/O apparatus,by using the WFD MAC (S32). Thereby, the portable terminal 50 can againparticipate in the normal Wi-Fi NW and the WFD NW.

According to case 1-5, in case the MFP 10 and the portable terminal 50do not belong to the same normal Wi-Fi NW and do not belong to the sameWFD NW, the MFP 10 shifts to the autonomy G/O mode, and canappropriately form the WFD NW (MFP=G/O). Consequently, the MFP 10 andthe portable terminal 50 can appropriately execute a wirelesscommunication for the target data not via another device by using theWFD NW (MFP=G/O).

Further, in case 1-5, if a configuration were adopted in which theportable terminal 50 secedes not from the normal Wi-Fi NW (terminal),but from the WFD NW (terminal=CL), the WFD NW could be dissolved. Thisis because the WFD NW is dissolved when the number of CL apparatusesbelonging to the WFD NW becomes zero. In this case, the portableterminal 50 cannot re-participate in this WFD NW. By contrast, in case1-5, since the portable terminal 50 does not secede from the WFD NW(terminal=CL), but secedes from the normal Wi-Fi NW (terminal), theportable terminal 50 can re-participate in the normal Wi-Fi NW after awireless communication for the target data has ended.

(Case 1-6; FIG. 8)

In case 1-6, a state of the portable terminal 50 is similar to that ofcase 1-5 of FIG. 7. Further, the MFP 10 belongs to not only the normalWi-Fi NW (SSID and BSSID=“X4, Y4”) formed by the AP 4B, but also to theWFD NW (MFP=G/O apparatus, PC 6B=CL apparatus, SSID and BSSID=“X6, Y6”).Moreover, in the WFD NW, “CH6” is being used as the channel value.

Upon receiving the demanding command from the portable terminal 50 (YESin S50 of FIG. 4), the MFP 10 determines, as with case 1-5 of FIG. 7,that the MFP 10 and the portable terminal 50 do not belong to the samenormal Wi-Fi NW (NO in S52). Further, the MFP 10 determines that neitherthe one set of SSID and BSSID “X1, Y1” in the demanding command, or theone set of SSID and BSSID “X3, Y3” in the demanding command is identicalto the one set of SSID and BSSID “X6, Y6” in the memory 34 (NO in S56).That is, the MFP 10 determines that the MFP 10 and the portable terminal50 do not belong to the same WFD NW.

Since the MFP 10 is in the G/O state, the MFP 10 determines NO in S60,and then determines YES in S62. In the present case, a number of CLapparatuses belonging to the WFD NW (MFP=G/O) is less than the maximumvalue, and consequently the MFP 10 determines NO in S66. Thereupon, theMFP 10 sends the WFD WSI in the memory 34 to the portable terminal 50 byusing an NFC communication (S70).

Upon receiving the WFD WSI from the MFP 10 (NO in S12, YES in S16 ofFIG. 3), the portable terminal 50 secedes from the normal Wi-Fi NW(terminal) (S20), as with case A of case 1-5 of FIG. 7, and participatesin the WFD NW (MFP=G/O) as a normal Wi-Fi apparatus (S26). Since thechannel value “CH3” and the channel value “CH6” are identical, when theportable terminal 50 participates in the WFD NW (MFP=G/O), the portableterminal 50 does not need to secede from the WFD NW (terminal).Subsequent operations are the same as case A of case 1-5 of FIG. 7.

According to case 1-6, in case the MFP 10 and the portable terminal 50do not belong to the same normal Wi-Fi NW, and do not belong to the sameWFD NW, the MFP 10 causes the portable terminal 50 to participate in theexisting WFD NW (MFP=G/O), and can appropriately form the WFD NW (MFP,terminal). Consequently, the MFP 10 and the portable terminal 50 canappropriately execute a wireless communication for the target data notvia another device by using the WFD NW (MFP, terminal).

(Case 1-7; FIG. 8)

In case 1-7, a state of the portable terminal 50 is the same as in case1-6. A state of the MFP 10 is the same as in case 1-6 except for thepoint that the MFP 10 belongs to a WFD NW in which the MFP 10 is a CLapparatus (MFP=CL apparatus, SSID and BSSID=“X7, Y7”).

The MFP 10 determines that the MFP 10 and the portable terminal 50 donot belong to the same normal Wi-Fi NW (NO in S52), and determines thatthe MFP 10 and the portable terminal 50 do not belong to the same WFD NW(NO in S56). Thereupon, since the state of the MFP 10 is the CL state,the MFP 10 determines YES in S60. In this case, the MFP 10 sends the NGinformation to the portable terminal 50 by using an NFC communication(S70).

Upon receiving the NG information from the MFP 10 (YES in S12 of FIG.3), the portable terminal 50 causes the error screen to be displayed onthe displaying unit 54 (S14). Thereby, the user can learn that awireless communication for the target data cannot be executed betweenthe MFP 10 and the portable terminal 50.

(Corresponding Relationships)

The MFP 10 and the portable terminal 50 are respectively examples of the“first communication apparatus” and the “second communicationapparatus”. The NFC I/F 22 (or 62) and the wireless LAN I/F 20 (or 60)are respectively examples of the “first type of interface” and the“second type of interface”. The G/O state and the CL state arerespectively examples of the “parent station state” and the “childstation state”. The WFD method having the G/O negotiation scheme, andthe normal Wi-Fi method not having the G/O negotiation scheme arerespectively examples of the “first wireless communication method” andthe “second wireless communication method”. Further, the print commandand the print data (or the scan command and the scan data) are anexample of the “target data”.

In case 1-1 of FIG. 5, the WFD NW (MFP, terminal) and the normal Wi-FiNW (MFP, terminal) are respectively examples of the “first wirelessnetwork” and the “second wireless network”. Consequently, the SSID andthe BSSID “X2, Y2”, and the SSID and the BSSID “X1, Y1” are respectivelyexamples of the “first identification information” and the “secondidentification information”. Thereupon, “X2”, “Y2”, “X1”, “Y1” arerespectively examples of the “first SSID”, the “first BSSID”, the“second SSID” and the “second BSSID”. Further, the normal Wi-Fi NW (MFP,terminal) is an example of the “at least one wireless network” and the“target wireless network”, and the normal usage information is anexample of the “usage information”. Further, in case 1-2 of FIG. 5, theWFD NW (MFP, terminal) is an example of the “at least one wirelessnetwork” and the “target wireless network”, and the WFD usageinformation is an example of the “usage information”.

Further, in case 1-5 of FIG. 7, the WFD NW (MFP=G/O), the normal Wi-FiNW (terminal) and the WFD NW (terminal=CL) are respectively examples ofthe “third wireless network”, the “one wireless network” and the “otherwireless network”. Further, the channel value “CH3” and the channelvalue “CH4” are respectively examples of the “first wireless channelvalue” and the “second wireless channel value”.

Second Embodiment; FIG. 9

Points differing from the first embodiment will be described. In thepresent embodiment, the controller 30 of the MFP 10 executes a flowchartof FIG. 9 instead of the flowchart of FIG. 4. In the present embodiment,unlike the first embodiment, the selection unit 42 executes thedetermination of S56 before the determination of S52. Consequently, in asituation where the MFP 10 and the portable terminal 50 belong to thesame normal Wi-Fi NW, and the MFP 10 and the portable terminal 50 belongto the same WFD NW (i.e., the specific situation), YES is determined inS56, and then in S58 the normal usage information instructing use of theWFD NW is sent to the portable terminal 50. That is, in the specificsituation, the selection unit 42 selects only the WFD NW (MFP,terminal).

(Case 2; FIG. 10)

In case 2, the MFP 10 and the portable terminal 50 have a state the sameas case 1-1 (i.e., the specific situation). Upon receiving the demandingcommand from the portable terminal 50 (YES in S50 of FIG. 9), the MFP 10determines that the MFP 10 and the portable terminal 50 belong to thesame WFD NW (YES in S56). Consequently, the MFP 10 sends the WFD usageinformation to the portable terminal 50 by using an NFC communication,(S58). Subsequent operations are the same case 1-2 of FIG. 5.

According to case 2, in the specific situation, the MFP 10 canappropriately select only the WFD NW (MFP, terminal). Consequently, theMFP 10 and the portable terminal 50 can appropriately execute a wirelesscommunication for the target data by using the WFD NW (MFP, terminal).

Known APs include APs having a privacy separator function. The privacyseparator function is a function for preventing a relay of wirelesscommunication between communication apparatuses. For example, in case 2,in case a privacy separator function of the AP 4A is enabled, the MFP 10and the portable terminal 50 cannot execute a wireless communication forthe target data via the AP 4A. In view of these circumstances, in thepresent embodiment, the MFP 10 preferentially selects not the normalWi-Fi NW (MFP, terminal), but the WFD NW (MFP, terminal). Thereby, evenif the privacy separator function of the AP 4A is enabled, the MFP 10and the portable terminal 50 can appropriately execute a wirelesscommunication for the target data by using the WFD NW (MFP, terminal).

Third Embodiment; FIG. 11

Points differing from the first embodiment will be described. In thepresent embodiment, the controller 30 of the MFP 10 executes a flowchartof FIG. 11 instead of the flowchart of FIG. 4. In the presentembodiment, the selection unit 42 executes a determination of S90. InS90, the selection unit 42 determines whether or not the MFP 10 and theportable terminal 50 belong to the same normal Wi-Fi NW and the same WFDNW. Specifically, in case two sets of SSID and BSSID are not included inthe demanding command, the selection unit 42 determines NO in S90 andthe process proceeds to S52. Processes from S52 onwards are the same asthose of FIG. 4.

Further, in case the first set of SSID and BSSID, among the two sets ofSSID and BSSID in the demanding command, is identical to the SSID andthe BSSID of the normal Wi-Fi NW in the memory 34, and the second set ofSSID and BSSID, among the two sets of SSID and BSSID in the demandingcommand, is identical to the SSID and the BSSID of the WFD NW in thememory 34, the selection unit 42 determines YES in S90, and the processproceeds to S92. Thereby, the selection unit 42 selects both the normalWi-Fi NW and the WFD NW.

In S92, the usage information sending unit 44 sends both the normalusage information and the WFD usage information to the portable terminal50 via the NFC I/F 22. Thereby, the portable terminal 50 determines NOin S16 of FIG. 3, and executes a wireless communication for the targetdata with the MFP 10 by using one wireless network from among the normalWi-Fi NW (MFP, terminal) and the WFD NW (MFP, terminal) (see S28). Thereis no particular restriction on a method used by the portable terminal50 to select the one wireless network. For example, in case the portableterminal 50 is executing a communication of the print data, the scandata, etc. with another device by using one wireless network from amongthe normal Wi-Fi NW (MFP, terminal) and the WFD NW (MFP, terminal), theportable terminal 50 may select the other wireless network. Further,e.g., the portable terminal 50 may select a wireless network randomly.

(Case 3; FIG. 12)

In case 3, the MFP 10 and the portable terminal 50 have the same stateas case 1-1 (i.e., the specific situation). Upon receiving the demandingcommand from the portable terminal 50 (YES in S50 of FIG. 11), the MFP10 determines that the MFP 10 and the portable terminal 50 belong to thesame normal Wi-Fi NW and the same WFD NW (YES in S90). Consequently, theMFP 10 sends the normal usage information and the WFD usage informationto the portable terminal 50 by using an NFC communication (S92).

Upon receiving the normal usage information and the WFD usageinformation from the MFP 10 (NO in S12, NO in S16 of FIG. 3), theportable terminal 50 selects e.g., the WFD NW (MFP, terminal) randomly,and sends the print command and the print data to the MFP 10 not viaanother device by using the WFD NW (MFP, terminal) (S28). Moreover, in avariant, the portable terminal 50 may select e.g., the normal Wi-Fi NW(MFP, terminal) randomly, and send the print command and the print datato the MFP 10 via the AP 4A by using the normal Wi-Fi NW (MFP,terminal).

According to case 3, in the specific situation, the MFP 10 canappropriately select both the normal Wi-Fi NW (MFP, terminal) and theWFD NW (MFP, terminal). Consequently, the MFP 10 and the portableterminal 50 can appropriately execute a wireless communication for thetarget data by using either of the normal Wi-Fi NW (MFP, terminal) andthe WFD NW (MFP, terminal).

Fourth Embodiment; FIG. 13

Points differing from the third embodiment will be described. In thepresent embodiment, in case the portable terminal 50 belongs to the WFDNW (terminal), in S10 of FIG. 3 the identification information sendingunit 86 sends a demanding command further including state informationindicating a current state (i.e., G/O state or CL state) of the portableterminal 50 to the MFP 10.

The controller 30 of the MFP 10 executes a flowchart of FIG. 13 insteadof the flowchart of FIG. 11. In S50 of FIG. 13, the identificationinformation receiving unit 41 of the MFP 10 may receive the demandingcommand including the state information from the portable terminal 50.In case the selection unit 42 determines YES in S90, the processproceeds to S94.

In S94, a state judgment unit 42A judges whether or not both the MFP 10and the portable terminal 50 are in the CL state. In case the WFD stateinformation in the memory 34 indicates CL state, and the stateinformation in the demanding command indicates CL state, the statejudgment unit 42A judges that both the MFP 10 and the portable terminal50 are in the CL state (YES in S94), and the process proceeds to S96. InS96, the usage information sending unit 44 sends the normal usageinformation to the portable terminal 50 via the NFC I/F 22. That is, incase of YES in S94, the selection unit 42 selects only the normal Wi-FiNW.

On the other hand, in case the WFD state information in the memory 34indicates G/O state, or the state information in the demanding commandindicates G/O state, the state judgment unit 42A judges that at leastone of the MFP 10 and the portable terminal 50 is not in the CL state(NO in S94), and the process proceeds to S98. In S98, the usageinformation sending unit 44 sends the WFD usage information to theportable terminal 50 via the NFC I/F 22. That is, in case of NO in S94,the selection unit 42 selects only the WFD NW.

(Case 4-1; FIG. 14)

In case 4-1, the MFP 10 and the portable terminal 50 belong to the sameWFD NW (SSID and BSSID=“X3, Y3”) in which the PC 6A is a G/O apparatus.That is, both the MFP 10 and the portable terminal 50 are in the CLstate. The MFP 10 and the portable terminal 50, further, belong to thenormal Wi-Fi NW. Consequently, case 4-1 is also the specific situation.

The demanding command includes state information indicating that theportable terminal 50 is in the CL state. Upon receiving the demandingcommand from the portable terminal 50 (YES in S50 of FIG. 13), the MFP10 determines that the MFP 10 and the portable terminal 50 belong to thesame normal Wi-Fi NW and the same WFD NW (YES in S90). Next, the MFP 10determines that both the MFP 10 and the portable terminal 50 are in theCL state (YES in S94). Consequently, the MFP 10 sends the normal usageinformation to the portable terminal 50 by using an NFC communication(S96).

In the situation of case 4-1, it is possible that a power source of thePC 6A, which is the G/O apparatus, is turned OFF before a wirelesscommunication of the print command and the print data is executed. Inthis case, because the WFD NW (MFP, terminal) is dissolved, the MFP 10and the portable terminal 50 cannot execute a wireless communication forthe target data by using the WFD NW (MFP, terminal). Consequently, inthe situation of case 4-1, if a configuration were adopted in which theMFP 10 selects the WFD NW (MFP, terminal), the MFP 10 and the portableterminal 50 might be unable to execute a wireless communication for thetarget data. In view of these circumstances, in the present embodiment,a configuration is adopted in which, in case both the MFP 10 and theportable terminal 50 are in the CL state, the MFP 10 selects the normalWi-Fi NW (MFP, terminal) (S96 of FIG. 13). Thereby, the MFP 10 and theportable terminal 50 can appropriately execute a wireless communicationfor the target data by using the normal Wi-Fi NW (MFP, terminal).

(Case 4-2; FIG. 14)

In case 4-2, the MFP 10 and the portable terminal 50 have the same stateas case 1-1 (i.e., the specific situation). That is, the MFP 10 is inthe G/O state. Consequently, the MFP 10 determines that at least one ofthe MFP 10 and the portable terminal 50 is not in the CL state (NO inS94), and sends the WFD usage information to the portable terminal 50 byusing an NFC communication (S98).

In the situation of case 4-2, it is unlikely that the power source ofthe MFP 10, which is the G/O apparatus, is turned OFF before a wirelesscommunication of the print command and the print data is executed. Thisis because the user does not usually turn OFF the power source of theMFP 10 due to knowing that a wireless communication of the print data isto be executed between the MFP 10 and the portable terminal 50.Consequently, in the present embodiment, a configuration is adopted inwhich, in case at least one of the MFP 10 and the portable terminal 50is not in the CL state, i.e., in case one of the MFP 10 and the portableterminal 50 is in the G/O state, the MFP 10 selects the WFD NW (MFP,terminal) (S98 of FIG. 13). Thereby, even in case the privacy separatorfunction of the AP 4A is enabled, the MFP 10 and the portable terminal50 can appropriately execute a wireless communication for the targetdata by using the WFD NW (MFP, terminal).

Fifth Embodiment

Points differing from the first embodiment will be described. In thefirst embodiment, the selection unit 42 of the MFP 10 selects thewireless network to be used in a wireless communication for the targetdata (see S52, S56 of FIG. 4). By contrast, in the present embodiment,the portable terminal 50 selects the wireless network.

(Application Process of Portable Terminal 50; FIG. 15)

In the present embodiment, the controller 70 of the portable terminal 50executes a flowchart of FIG. 15 instead of the flowchart of FIG. 3. InS100, the controller 70 sends the demanding command to the MFP 10 viathe NFC I/F 62. The demanding command does not include the SSID and theBSSID even in case the portable terminal 50 belongs to at least one ofthe normal Wi-Fi NW (terminal) and the WFD NW (terminal).

In S102, an identification information receiving unit 81 receivesresponse data from the MFP 10 via the NFC I/F 62. In case the MFP 10belongs to the normal Wi-Fi NW (MFP), the response data includes theSSID and the BSSID of the normal Wi-Fi NW (MFP). Further, in case theMFP 10 belongs to the WFD NW (MFP), the response data includes the SSIDand the BSSID of the WFD NW (MFP).

In S104, a selection unit 82 determines whether or not the MFP 10 andthe portable terminal 50 belong to the same normal Wi-Fi NW (MFP,terminal). A determination method of S104 is the same as S52 of FIG. 4,with the exception that the information in the memory 74, and theinformation in the response data received from the MFP 10 is used. Incase the selection unit 82 determines that the MFP 10 and the portableterminal 50 belong to the same normal Wi-Fi NW (MFP, terminal) (YES inS104), the process proceeds to S130. Thereby, the selection unit 82selects only the normal Wi-Fi NW (MFP, terminal). On the other hand, incase of determining that the MFP 10 and the portable terminal 50 do notbelong to the same normal Wi-Fi NW (MFP, terminal) (NO in S104), theselection unit 82 proceeds to S106.

In S106, the selection unit 82 determines whether or not the MFP 10 andthe portable terminal 50 belong to the same WFD NW (MFP, terminal). Adetermination method of S106 is the same as S56 of FIG. 4, with theexception that the information in the memory 74, and the information inthe response data received from the MFP 10 is used. In case ofdetermining that the MFP 10 and the portable terminal 50 belong to thesame WFD NW (MFP, terminal) (YES in S106), the selection unit 82proceeds to S130. Thereby, the selection unit 82 selects only the WFD NW(MFP, terminal). On the other hand, in case the selection unit 82determines that the MFP 10 and the portable terminal 50 do not belong tothe same WFD NW (MFP, terminal) (NO in S106), the process proceeds toS110.

Below, processes from S110 onwards are described simply. However,contents of S110 to S118 can be understood in detail by referring to S60to S68 of FIG. 4. In S110, the controller 70 determines whether or not acurrent state of the portable terminal 50 is CL state. In S112, thecontroller 70 determines whether or not a current state of the portableterminal 50 is G/O state. In S116, the controller 70 determines whetheror not a number of CL apparatuses belonging to the WFD NW (terminal=G/O)is identical to the predetermined maximum value.

In case of YES in S110, in S118 the controller 70 sends the NGinformation to the MFP 10 via the NFC I/F 62. Next, in S120 thecontroller 70 causes the error screen to be displayed on the displayingunit 54. When S120 ends, the process of FIG. 15 ends.

In case of NO in S112, in S114 the controller 70 shifts the portableterminal 50 to the autonomy G/O mode. When S114 ends, in S122 a settinginformation sending unit 85 sends the WFD WSI in the memory 74 to theMFP 10 via the NFC I/F 22. Next, in S124 the controller 70 establishes aconnection with the MFP 10. Thereby, the MFP 10 can participate in theWFD NW (terminal=G/O). When S124 ends, the process proceeds to S130.

In S130, the communication execution unit 83 executes the processesbelow. For example, in case of YES in S104, the communication executionunit 83 executes a wireless communication for the target data with theMFP 10 by using the normal Wi-Fi NW (MFP, terminal). Further, e.g., incase of YES in S106, the communication execution unit 83 executes awireless communication for the target data with the MFP 10 by using theWFD NW (MFP, terminal). Further, e.g., in case S124 was executed, thecommunication execution unit 83 executes a wireless communication forthe target data with the MFP 10 by using the WFD NW (terminal=G/O). WhenS130 ends, the process of FIG. 15 ends.

Moreover, in the present embodiment, the normal usage information andthe WFD usage information are not sent from the portable terminal 50 tothe MFP 10. This is because, if the portable terminal 50 sends the printcommand or the scan command to the MFP 10 by using the normal Wi-Fi NW(MFP, terminal) or the WFD NW (MFP, terminal), the MFP 10 can know whichwireless network should be used to execute a wireless communication ofthe print data or the scan data.

(Communication Process of MFP 10; FIG. 16)

In the present embodiment, the controller 30 of the MFP 10 executes aflowchart of FIG. 16 instead of the flowchart of FIG. 4. In case ofreceiving a demanding command from the portable terminal 50 via the NFCI/F 22, the controller 30 determines YES in S200, and the processproceeds to S202. In S202, an identification information sending unit 46sends response data to the portable terminal 50 via the NFC I/F 22. Asdescribed above, the response data includes the SSID and the BSSID ofthe wireless network to which the MFP 10 belongs.

Below, processes from S204 onwards are described simply. However,contents of S204 to S222 can be understood in detail by referring to S12to S32 of FIG. 3. In case of receiving the NG information from theportable terminal 50 via the NFC I/F 22 (see S118 of FIG. 15), thecontroller 30 determines YES in S204, and ends the process of FIG. 16.Further, in case of receiving the WFD WSI from the portable terminal 50via the NFC I/F 22 (see S122 of FIG. 15), a setting informationreceiving unit 47 determines YES in S206, and the process proceeds toS208.

In S208, a seceding control unit 48 determines whether or not the MFP 10currently belongs to the normal Wi-Fi NW. In case of determining thatthe portable terminal 50 currently belongs to the normal Wi-Fi NW (YESin S208), the seceding control unit 48 proceeds to S210. In S210, theseceding control unit 48 causes the MFP 10 to secede from the normalWi-Fi NW (MFP).

In S216, by using the normal Wi-Fi MAC, a participating control unit 49participates in the WFD NW (terminal=G/O) as a normal Wi-Fi apparatus.Moreover, the participating control unit 49 does not cause the MFP 10 tosecede from the WFD NW (MFP) in case a channel value being used in theWFD NW (terminal=G/O) and a channel value being used in the WFD NW (MFP)are identical, but does secede the MFP 10 from the WFD NW (MFP) in casethe values of the two channels are not identical. When S216 ends, theprocess proceeds to S218.

Further, in case of receiving the print command or the scan command fromthe portable terminal 50 via the wireless LAN I/F 20 (see S130 of FIG.15), the controller 30 determines NO in S206, and the process proceedsto S218. In S218, the communication execution unit 43 executes awireless communication of the print data or the scan data with theportable terminal 50 via the wireless LAN I/F 20 by using the wirelessnetwork in which the print command or the scan command was received.

In case the MFP 10 has seceded from at least one of the normal Wi-Fi NW(MFP) and the WFD NW (MFP), the controller 30 determines YES in S220,and proceeds to S222. In S222, the controller 30 attempts to cause theMFP 10 to re-participate in the wireless network from which the MFP 10seceded. When S222 ends, the process of FIG. 16 ends.

(Case 5-1; FIG. 17)

In case 5-1, the MFP 10 and the portable terminal 50 have the same stateas case 1-1 of FIG. 5 (i.e., the specific situation). Upon receiving thedemanding command from the portable terminal 50 by using an NFCcommunication (YES in S200 of FIG. 16), the MFP 10 sends response dataincluding the two sets of SSID and BSSID “X1, Y1”, “X2, Y2” to theportable terminal 50.

The portable terminal 50 determines that the MFP 10 and the portableterminal 50 belong to the same normal Wi-Fi NW (MFP, terminal) (YES inS104 of FIG. 15). Consequently, the portable terminal 50 sends the printcommand and the print data to the MFP 10 via the AP 4A by using thenormal Wi-Fi NW (MFP, terminal) (S130).

According to case 5-1, in the specific situation, the portable terminal50 can appropriately select only the normal Wi-Fi NW (MFP, terminal).Consequently, the MFP 10 and the portable terminal 50 can appropriatelyexecute a wireless communication for the target data by using the normalWi-Fi NW (MFP, terminal).

(Case 5-2; FIG. 17)

In case 5-2, the MFP 10 and the portable terminal 50 belong to the sameWFD NW (MFP, terminal). Further, the portable terminal 50 belongs to thenormal Wi-Fi NW (terminal), whereas the MFP 10 does not belong to thenormal Wi-Fi NW. Upon receiving the demanding command from the portableterminal 50 (YES in S200 of FIG. 16), the MFP 10 sends response dataincluding the one set of SSID and BSSID “X2, Y2” to the portableterminal 50 by using an NFC communication.

The portable terminal 50 determines that the MFP 10 and the portableterminal 50 do not belong to the same normal Wi-Fi NW (NO in S104 ofFIG. 15), and then determines that the MFP 10 and the portable terminal50 belong to the same WFD NW (MFP, terminal) (YES in S106).Consequently, the portable terminal 50 sends the print command and theprint data to the MFP 10 not via another device by using the WFD NW(MFP, terminal) (S130).

According to case 5-2, in case the MFP 10 and the portable terminal 50do not belong to the same normal Wi-Fi NW but belong to the same WFD NW,the portable terminal 50 can appropriately select only the WFD NW (MFP,terminal). Consequently, the MFP 10 and the portable terminal 50 canappropriately execute a wireless communication for the target data byusing the WFD NW (MFP, terminal). Moreover, in the present embodiment,the MFP 10 and the portable terminal 50 are respectively examples of the“second communication apparatus” and the “first communicationapparatus”.

(Variant 1)

In the fifth embodiment, the selection unit 82 of the portable terminal50 executes the process of S104 of FIG. 15 before the process of S106.That is, as in the first embodiment, a configuration is also adopted inthe fifth embodiment in which only the normal Wi-Fi NW (MFP, terminal)is selected in the specific situation. Instead, the selection unit 82may execute the process of S106 of FIG. 15 before the process of S104.That is, in the specific situation, the selection unit 82 may selectonly the WFD NW (MFP, terminal). In the present variant, the sameresults as in the second embodiment can be obtained. Further, theselection unit 82 may comprise a state judgment unit 82A. In this case,as with S94 of FIG. 13 of the fourth embodiment, in the specificsituation, the state judgment unit 82A judges whether both the MFP 10and the portable terminal 50 are in the CL state, and may select onlythe normal Wi-Fi NW (MFP, terminal) in case both the MFP 10 and theportable terminal 50 are in the CL state, or may select only the WFD NW(MFP, terminal) in case at least one of the MFP 10 and the portableterminal 50 is not in the CL state. In the present variant, the sameresults as in the fourth embodiment can be obtained.

(Variant 2)

In the first to fifth embodiments, the selection units 42, 82 executeboth the determination of whether SSIDs are identical and thedetermination of whether BSSIDs are identical. Instead, the selectionunits 42, 82 may execute only the determination of whether SSIDs areidentical. For example, in the first to fourth embodiments, thedemanding command need not include the BSSID. In this case, in case anSSID identical to the SSID of the normal Wi-Fi NW (MFP) in the memory 34is included in the demanding command, in S52 of FIG. 4 the selectionunit 42 may determine that the MFP 10 and the portable terminal 50belong to the same normal Wi-Fi NW (YES in S52). Further, in case anSSID identical to the SSID of the WFD NW (MFP) in the memory 34 isincluded in the demanding command, in S56 of FIG. 4 the selection unit42 may determine that the MFP 10 and the portable terminal 50 belong tothe same WFD NW (YES in S56).

Further, in e.g., the first to fourth embodiments, the demanding commandneed not include an SSID. In this case, in case a BSSID identical to theBSSID of the normal Wi-Fi NW (MFP) in the memory 34 is included in thedemanding command, in S52 of FIG. 4 the selection unit 42 may determinethat the MFP 10 and the portable terminal 50 belong to the same normalWi-Fi NW (YES in S52). Further, in case a BSSID identical to the BSSIDof the WFD NW (MFP) in the memory 34 is included in the demandingcommand, in S56 of FIG. 4 the selection unit 42 may determine that theMFP 10 and the portable terminal 50 belong to the same WFD NW (YES inS56).

In the present variant, also, the selection units 42, 82 canappropriately select a wireless network to which both the MFP 10 and theportable terminal 50 belong. In general terms, the selection unit mayselect at least one wireless network by using at least one of the SSIDand the BSSID.

(Variant 3)

The “first wireless network” is not restricted to the WFD NW, but may bea normal Wi-Fi NW formed by an AP, may be a normal Wi-Fi NW formed by anapparatus (e.g., the PC 6A) functioning as a so-called Soft AP, or maybe an ad hoc wireless network. Further, e.g., the “second wirelessnetwork” is not restricted to the normal Wi-Fi NW formed by an AP, butmay be a normal Wi-Fi NW formed by an apparatus (e.g., the PC 6A)functioning as a so-called Soft AP, may be an ad hoc wireless network,or may be a WFD NW. Further, the “first and second wireless networks”may be the same type of wireless network. For example, the “firstwireless network” may be a first normal Wi-Fi NW, and the “secondwireless network” may be a second normal Wi-Fi NW.

(Variant 4)

The “first type of interface” is not restricted to an interface forexecuting an NFC communication, but may be an interface for executing aninfrared communication, may be an interface for executing Bluetooth(registered trademark), or may be an interface for executing TransferJet. For example, a communication speed of a wireless communication viathe second type of interface may be faster than a communication speed ofa wireless communication via the first type of interface.

(Variant 5)

The “first type and the second type of interface” may be two interfaces(e.g., two IC chips) configured separately, as in the above embodiments,or may be one interface (e.g., one IC chip) configured integrally.Further, in the above embodiments, the “second type of interface” is oneinterface (i.e., the wireless LAN I/F 20 or the wireless LAN I/F 60).Instead, the “second type of interface” may be configured by, e.g., afirst interface (i.e., one IC chip) for executing a normal Wi-Ficommunication, and a second interface (i.e., one IC chip) for executinga WFD communication and that is configured separately from the firstinterface.

(Variant 6)

The “communication apparatus” is not restricted to the MFP 10 or theportable terminal 50, but may be another communication apparatus (e.g.,printer, scanner, FAX device, copier, telephone, desktop PC, server,etc.).

(Variant 7)

In the above embodiments, the functions of the units 41 to 49, 81 to 89are realized by the CPUs 32, 72 of the MFP 10 and the portable terminal50 executing programs (i.e., software) in the memories 34, 74. Instead,at least one of the units 41 to 49, 81 to 89 may be realized by hardwaresuch as a logic circuit, etc.

What is claimed is:
 1. A non-transitory computer-readable medium storingcomputer-readable instructions for a first communication apparatus, whenexecuted by a controller of the first communication apparatus, causingthe first communication apparatus to perform: receiving firstinformation for identifying a first wireless network and secondinformation for determining whether the first communication apparatusbelongs to a second wireless network via a first type of interface ofthe first communication apparatus from a second communication apparatus,the first wireless network being for executing a communication not viaan access point different from both the first communication apparatusand the second communication apparatus, the second wireless networkbeing for executing a communication via the access point, the firstwireless network being for executing a communication via an interface ofwhich communication speed is faster than a communication speed of thefirst type of interface, the second wireless network being for executinga communication via an interface of which communication speed is fasterthan the communication speed of the first type of interface;determining, based on the second information, whether the firstcommunication apparatus belongs to the second wireless network in a casewhere the first information and the second information are received;executing a wireless communication of target data with the secondcommunication apparatus by using the second wireless network in a casewhere it is determined that the first communication apparatus belongs tothe second wireless network; and executing the wireless communication ofthe target data with the second communication apparatus by using thefirst wireless network identified by the first information received withthe second information in a case where it is determined that the firstcommunication apparatus does not belong to the second wireless network.2. The non-transitory computer-readable medium as in claim 1, whereinthe first information includes at least one of an SSID of a wirelessnetwork being for executing a communication not via the access point anda BSSID of the wireless network being for executing a communication notvia the access point; and the second information includes at least oneof an SSID of a wireless network being for executing a communication viathe access point and an BSSID of the wireless network being forexecuting a communication via the access point.
 3. The non-transitorycomputer-readable medium as in claim 1, wherein the second wirelessnetwork and the first wireless network are for executing a communicationvia same interface.
 4. The non-transitory computer-readable medium as inclaim 1, wherein the first type of interface is for executing an NFC (anabbreviation of Near Field Communication) communication.
 5. Thenon-transitory computer-readable medium as in claim 1, wherein thesecond communication apparatus is a portable terminal.
 6. A firstcommunication apparatus comprising: a first type of interface; aprocessor; and a memory storing computer-readable instructions therein,the computer-readable instructions, when executed by the processor,causing the first communication apparatus to perform: receiving firstinformation for identifying a first wireless network and secondinformation for determining whether the first communication apparatusbelongs to a second wireless network via the first type of interfacefrom a second communication apparatus, the first wireless network beingfor executing a communication not via an access point different fromboth the first communication apparatus and the second communicationapparatus, the second wireless network being for executing acommunication via the access point, the first wireless network being forexecuting a communication via an interface of which communication speedis faster than a communication speed of the first type of interface, thesecond wireless network being for executing a communication via aninterface of which communication speed is faster than the communicationspeed of the first type of interface; determining, based on the secondinformation, whether the first communication apparatus belongs to thesecond wireless network in a case where the first information and thesecond information are received; executing a wireless communication oftarget data with the second communication apparatus by using the secondwireless network in a case where it is determined that the firstcommunication apparatus belongs to the second wireless network; andexecuting the wireless communication of the target data with the secondcommunication apparatus by using the first wireless network identifiedby the first information received with the second information in a casewhere it is determined that the first communication apparatus does notbelong to the second wireless network
 7. The first communicationapparatus as in claim 6, wherein the first information includes at leastone of an SSID of a wireless network being for executing a communicationnot via the access point and a BSSID of the wireless network being forexecuting a communication not via the access point; and the secondinformation includes at least one of an SSID of a wireless network beingfor executing a communication via the access point and an BSSID of thewireless network being for executing a communication via the accesspoint.
 8. The first communication apparatus as in claim 6, wherein thesecond wireless network and the first wireless network are for executinga communication via same interface.
 9. The first communication apparatusas in claim 6, wherein the first type of interface is for executing anNFC (an abbreviation of Near Field Communication) communication.
 10. Thefirst communication apparatus as in claim 6, wherein the secondcommunication apparatus is a portable terminal.
 11. A non-transitorycomputer-readable medium storing computer-readable instructions for asecond communication apparatus, when executed by a controller of thesecond communication apparatus, causing the second communicationapparatus to perform: sending first information for identifying a firstwireless network and second information for determining whether a firstcommunication apparatus belongs to a second wireless network via a firsttype of interface of the second communication apparatus to the firstcommunication apparatus, the first wireless network being for executinga communication not via an access point different from both the firstcommunication apparatus and the second communication apparatus, thesecond wireless network being for executing a communication via theaccess point, the first wireless network being for executing acommunication via an interface of which a communication speed is fasterthan a communication speed of the first type of interface, the secondwireless network being for executing a communication via an interface ofwhich a communication speed is faster than a communication speed of thefirst type of interface; executing a wireless communication of targetdata with the first communication apparatus by using the second wirelessnetwork in a case where the first communication apparatus determines,based on the second information, that the first communication apparatusbelongs to the second wireless network; and executing the wirelesscommunication of the target data with the first communication apparatusby using the first wireless network identified by the first informationsent to the first information in a case where the first communicationapparatus determines, based on the second information, that the firstcommunication apparatus does not belong to the second wireless network.12. The non-transitory computer-readable medium as in claim 11, whereinthe first information includes at least one of an SSID of a wirelessnetwork being for executing a communication not via the access point anda BSSID of the wireless network being for executing a communication notvia the access point; and the second information includes at least oneof an SSID of a wireless network being for executing a communication viathe access point and an BSSID of the wireless network being forexecuting a communication via the access point.
 13. The non-transitorycomputer-readable medium as in claim 11, wherein the second wirelessnetwork and the first wireless network are for executing a communicationvia same interface.
 14. The non-transitory computer-readable medium asin claim 11, wherein the first type of interface is for executing an NFC(an abbreviation of Near Field Communication) communication.
 15. Thenon-transitory computer-readable medium as in claim 11, wherein thesecond communication apparatus is a portable terminal.